From: <tho...@us...> - 2013-11-10 15:01:56
|
Revision: 7522 http://bigdata.svn.sourceforge.net/bigdata/?rev=7522&view=rev Author: thompsonbry Date: 2013-11-10 15:01:49 +0000 (Sun, 10 Nov 2013) Log Message: ----------- Bug fix to test case. It was failing to ensure that the default file did not exist before running the zero-argument BigdataSail constructor. This was failing the test on AWS using EBS. Added Options.DEFAULT_FILE to BigdataSail to make this default value visible. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/TestBootstrapBigdataSail.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java 2013-11-09 14:42:27 UTC (rev 7521) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java 2013-11-10 15:01:49 UTC (rev 7522) @@ -377,6 +377,15 @@ public static final String DESCRIBE_STATEMENT_LIMIT = BigdataSail.class .getPackage().getName() + ".describeIterationStatementLimit"; + /** + * The name of the default value used for the + * {@link Journal.Options#FILE} property by the + * {@link BigdataSail#BigdataSail()} convenience constructor. + * + * @see BigdataSail#BigdataSail() + */ + public static final String DEFAULT_FILE = "bigdata" + JNL; + } /** @@ -557,9 +566,9 @@ */ private static Properties getDefaultProperties() { - Properties properties = new Properties(); + final Properties properties = new Properties(); - properties.setProperty(Options.FILE, "bigdata" + Options.JNL); + properties.setProperty(Options.FILE, Options.DEFAULT_FILE); return properties; Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/TestBootstrapBigdataSail.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/TestBootstrapBigdataSail.java 2013-11-09 14:42:27 UTC (rev 7521) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/TestBootstrapBigdataSail.java 2013-11-10 15:01:49 UTC (rev 7522) @@ -29,6 +29,7 @@ import info.aduna.iteration.CloseableIteration; import java.io.File; +import java.io.IOException; import java.util.Properties; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; @@ -76,7 +77,7 @@ /** * @param arg0 */ - public TestBootstrapBigdataSail(String arg0) { + public TestBootstrapBigdataSail(final String arg0) { super(arg0); } @@ -84,13 +85,32 @@ * Test create and shutdown of the default store. * * @throws SailException + * @throws IOException */ - public void test_ctor_1() throws SailException { + public void test_ctor_1() throws SailException, IOException { + final File file = new File(BigdataSail.Options.DEFAULT_FILE); + + /* + * If the default file exists, then delete it before creating the SAIL. + */ + if (file.exists()) { + + if (!file.delete()) { + + throw new IOException("Unable to remove default file:" + file); + + } + + } + final BigdataSail sail = new BigdataSail(); try { + if (!file.exists()) + fail("Expected file does not exist: " + file); + sail.initialize(); sail.shutDown(); @@ -111,15 +131,15 @@ public void test_ctor_2() throws SailException { final File file = new File(getName() + Options.JNL); - - if(file.exists()) { - - if(!file.delete()) { - + + if (file.exists()) { + + if (!file.delete()) { + fail("Could not delete file before test: " + file); } - + } final Properties properties = new Properties(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-05-13 19:45:07
|
Revision: 8299 http://sourceforge.net/p/bigdata/code/8299 Author: thompsonbry Date: 2014-05-13 19:45:03 +0000 (Tue, 13 May 2014) Log Message: ----------- Commit: possible fix for test failure in test_webapp_structure_counters. {{{ java.io.UnsupportedEncodingException: 'UTF-8' at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:71) at java.io.InputStreamReader.<init>(InputStreamReader.java:100) at org.apache.http.util.EntityUtils.toString(EntityUtils.java:195) at org.apache.http.util.EntityUtils.toString(EntityUtils.java:221) at com.bigdata.rdf.sail.webapp.TestNanoSparqlClient.doGET(TestNanoSparqlClient.java:254) at com.bigdata.rdf.sail.webapp.TestNanoSparqlClient.test_webapp_structure_counters(TestNanoSparqlClient.java:210) }}} Changes are to CountersServlet (change in how the encoding is set on the http response) and TestNanoSparqlClient (we were getting the HttpEntity twice - it is doubtless a cached object reference so I doubt this is the issue). Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/CountersServlet.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlClient.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/CountersServlet.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/CountersServlet.java 2014-05-13 19:32:10 UTC (rev 8298) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/CountersServlet.java 2014-05-13 19:45:03 UTC (rev 8299) @@ -217,8 +217,15 @@ resp.setStatus(HTTP_OK); - resp.setContentType(mimeType + "; charset='" + charset + "'"); + resp.setContentType(mimeType); + if (format.hasCharset()) { + + // Note: Binary encodings do not specify charset. + resp.setCharacterEncoding(format.getCharset().name()); + + } + /* * Sets the cache behavior -- the data should be good for up to 60 * seconds unless you change the query parameters. These cache control Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlClient.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlClient.java 2014-05-13 19:32:10 UTC (rev 8298) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlClient.java 2014-05-13 19:45:03 UTC (rev 8299) @@ -251,7 +251,7 @@ entity = response.getEntity(); - final String content = EntityUtils.toString(response.getEntity()); + final String content = EntityUtils.toString(entity); return content; @@ -260,6 +260,7 @@ try { EntityUtils.consume(entity); } catch (IOException ex) { + log.warn(ex, ex); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-05-14 15:02:21
|
Revision: 8312 http://sourceforge.net/p/bigdata/code/8312 Author: thompsonbry Date: 2014-05-14 15:02:17 +0000 (Wed, 14 May 2014) Log Message: ----------- Still working on the LBS host scoring logic. Modified Paths: -------------- 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/HostScore.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/lbs/TestAbstractHostLBSPolicy.java 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 14:16:19 UTC (rev 8311) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractHostLBSPolicy.java 2014-05-14 15:02:17 UTC (rev 8312) @@ -539,9 +539,9 @@ final IHostMetrics[] metrics2 = new IHostMetrics[nhosts]; - final double[] hostScores = new double[nhosts]; + final double[] load = new double[nhosts]; - double totalScore = 0d; + double totalLoad = 0d; { @@ -583,30 +583,40 @@ hostnames[i] = hostname; - hostScores[i] = hostScore; + load[i] = hostScore; metrics2[i] = metrics; - totalScore += hostScore; + totalLoad += hostScore; i++; } - - if (totalScore == 0) { - - /* - * If totalScore is zero, then weight all hosts equally as - * (1/nhosts). - */ - - totalScore = nhosts; - - } } /* + * Convert from LOAD to AVAILABILITY. + * + * AVAILABILITY := TOTAL - LOAD[i] + * + * Note: The per-host metrics and scoring rule give us LOAD. However, we + * want to distribute the requests based on the inverse of the load, + * which is the AVAILABILITY to do more work. + */ + double totalAvailability = 0; + double availability[] = new double[nhosts]; + { + for (int i = 0; i < nhosts; i++) { + + final double avail = totalLoad - load[i]; + + totalAvailability += avail; + + } + } + + /* * Normalize the per-hosts scores. */ @@ -614,13 +624,22 @@ final HostScore[] scores = new HostScore[nhosts]; { - for (int i = 0; i < scores.length; i++) { + for (int i = 0; i < nhosts; i++) { final String hostname = hostnames[i]; + final double normalizedAvailability; + if (totalAvailability == 0) { + // divide the work evenly. + normalizedAvailability = 1d / nhosts; + } else { + normalizedAvailability = availability[i] + / totalAvailability; + } + // Normalize host scores. final HostScore hostScore = scores[i] = new HostScore(hostname, - hostScores[i], totalScore, metrics2[i], scoringRule); + normalizedAvailability); if (thisHostScore != null && hostScore.isThisHost()) { 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 14:16:19 UTC (rev 8311) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/HostScore.java 2014-05-14 15:02:17 UTC (rev 8312) @@ -41,12 +41,12 @@ */ private final boolean thisHost; - /** - * The raw score for some host. This is a measure of the load on a host. The - * measure is computed based on {@link #metrics} using the - * {@link #scoringRule}. - */ - private final double rawScore; +// /** +// * The raw score for some host. This is a measure of the load on a host. The +// * measure is computed based on {@link #metrics} using the +// * {@link #scoringRule}. +// */ +// private final double rawScore; /** * The normalized score for that host. @@ -59,18 +59,18 @@ */ private final double score; - /** - * The {@link IHostScoringRule} used to convert the {@link #metrics} into - * the {@link #rawScore}. - */ - private final IHostScoringRule scoringRule; - - /** - * The {@link IHostMetrics} associated with this host (this is - * informational. The {@link #metrics} provide the detailed per-host - * performance metrics that were intepreted by the {@link #scoringRule} . - */ - final private IHostMetrics metrics; +// /** +// * The {@link IHostScoringRule} used to convert the {@link #metrics} into +// * the {@link #rawScore}. +// */ +// private final IHostScoringRule scoringRule; +// +// /** +// * The {@link IHostMetrics} associated with this host (this is +// * informational. The {@link #metrics} provide the detailed per-host +// * performance metrics that were intepreted by the {@link #scoringRule} . +// */ +// final private IHostMetrics metrics; // /** The rank in [0:#scored]. This is an index into the Scores[]. */ // public int rank = -1; @@ -78,14 +78,14 @@ // /** The normalized double precision rank in [0.0:1.0]. */ // public double drank = -1d; - /** - * 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 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 normalized load for the host. @@ -105,22 +105,22 @@ return hostname; } - /** - * 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; - } - - /** - * The {@link IHostScoringRule} used to convert the {@link #getMetrics()} - * into the {@link #getRawScore()} (optional). - */ - public IHostScoringRule getScoringRule() { - return scoringRule; - } +// /** +// * 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; +// } +// +// /** +// * The {@link IHostScoringRule} used to convert the {@link #getMetrics()} +// * into the {@link #getRawScore()} (optional). +// */ +// public IHostScoringRule getScoringRule() { +// return scoringRule; +// } /** * Return <code>true</code> iff the host is this host. @@ -135,12 +135,12 @@ return "HostScore"// + "{hostname=" + hostname // + ", thisHost=" + thisHost// - + ", rawScore=" + rawScore // +// + ", rawScore=" + rawScore // + ", score=" + score // // + ", rank=" + rank // // + ", drank=" + drank // - + ", metrics=" + metrics // - + ", scoringRule=" + scoringRule // +// + ", metrics=" + metrics // +// + ", scoringRule=" + scoringRule // + "}"; } @@ -149,22 +149,25 @@ * * @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). + * @param score The normalized availability score for this + * host. +// * @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// + final double score +// final double rawScore,// +// final double totalRawScore // +// final IHostMetrics metrics,// +// final IHostScoringRule scoringRule// ) { if (hostname == null) @@ -173,54 +176,59 @@ if (hostname.trim().length() == 0) throw new IllegalArgumentException(); + if (score < 0d || score > 1d) + throw new IllegalArgumentException(); + this.hostname = hostname; - this.rawScore = rawScore; + this.score = score; + +// this.rawScore = rawScore; this.thisHost = AbstractStatisticsCollector.fullyQualifiedHostName .equals(hostname); - this.scoringRule = scoringRule; +// this.scoringRule = scoringRule; +// +// this.metrics = metrics; - this.metrics = metrics; +// score = normalize(rawScore, totalRawScore); - score = normalize(rawScore, totalRawScore); - } - /** - * Computes the normalized {@link #score} from the {@link #rawScore} in the - * context of total over the {@link #rawScore}s for some set of hosts. - * - * @param rawScore - * The raw score. - * @param totalRawScore - * The raw score computed from the totals. - * - * @return The normalized score. - */ - static private double normalize(final double rawScore, - final double totalRawScore) { +// /** +// * Computes the normalized {@link #score} from the {@link #rawScore} in the +// * context of total over the {@link #rawScore}s for some set of hosts. +// * +// * @param rawScore +// * The raw score. +// * @param totalRawScore +// * The raw score computed from the totals. +// * +// * @return The normalized score. +// */ +// static private double normalize(final double rawScore, +// final double totalRawScore) { +// +// if (totalRawScore == 0d) { +// +// return 0d; +// +// } +// +// final double score = rawScore / totalRawScore; +// +// if (score < 0 || score > 1) { +// +// throw new RuntimeException("score(" + score + ") := rawScore(" +// + rawScore + ") / totalRawScore(" + totalRawScore + ")"); +// +// } +// +// return score; +// +// } - if (totalRawScore == 0d) { - - return 0d; - - } - - 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 decreasing {@link #getScore() normalized * load}. The {@link #getHostname()} is used to break any ties (but this Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/lbs/TestAbstractHostLBSPolicy.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/lbs/TestAbstractHostLBSPolicy.java 2014-05-14 14:16:19 UTC (rev 8311) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/lbs/TestAbstractHostLBSPolicy.java 2014-05-14 15:02:17 UTC (rev 8312) @@ -22,7 +22,6 @@ */ package com.bigdata.rdf.sail.webapp.lbs; -import java.util.Arrays; import java.util.Random; import java.util.UUID; import java.util.concurrent.atomic.AtomicInteger; @@ -75,8 +74,7 @@ final String H1 = "H1"; // The load scores for those hosts. - final HostScore hostScore1 = new HostScore("H1", .5d/* rawScore */, - .5d/* totalRawScore */, null/* scoringRule */, null/* metrics */); + final HostScore hostScore1 = new HostScore("H1", 1d); // should sum to 1.0 assertEquals(1d, hostScore1.getScore()); @@ -191,180 +189,177 @@ * This test covers the case with 3 hosts, each running one service. */ public void test_HA3() { - - /* - * The load scores for those hosts. - * - * Note: These need to be ordered by increasing load. That is how they - * are sorted by the LBS code. The running totals in terms of the - * normalized load. - */ - final double totalRawScore = 1.5d; - final HostScore hostScore0 = new HostScore("H0", .2d/* rawScore */, - totalRawScore, null/*scoringRule*/, null/* metrics */); // score=.533 - final HostScore hostScore1 = new HostScore("H1", .5d/* rawScore */, - totalRawScore, null/*scoringRule*/, null/* metrics */); // score=.333, total=.866 - final HostScore hostScore2 = new HostScore("H2", .8d/* rawScore */, - totalRawScore, null/*scoringRule*/, null/* metrics */); // score=.133, total=1.00 +// +// /* +// * The load scores for those hosts. +// * +// * Note: These need to be ordered by increasing load. That is how they +// * are sorted by the LBS code. The running totals in terms of the +// * normalized load. +// */ +// final double totalRawScore = 1.5d; +// final HostScore hostScore0 = new HostScore("H0", .2d); // score=.533 +// final HostScore hostScore1 = new HostScore("H1", .5d); // score=.333, total=.866 +// final HostScore hostScore2 = new HostScore("H2", .8d); // score=.133, total=1.00 +// +// /* +// * Show scores. Decision is made on the *normalized* score. Since we +// * want to assign work based on inverse load, "normalized" is defined as +// * (1-load)/total +// */ +// log.warn("H1=" + hostScore0); +// log.warn("H2=" + hostScore1); +// log.warn("H3=" + hostScore2); +// +// // verify total of the raw scores. +// assertEquals(totalRawScore, hostScore0.getRawScore() + hostScore1.getRawScore() +// + hostScore2.getRawScore()); +// +// // verify individual normalized scores. +// assertEquals(hostScore0.getScore(), (1d-hostScore0.getRawScore()) / totalRawScore); +// assertEquals(hostScore1.getScore(), (1d-hostScore1.getRawScore()) / totalRawScore); +// assertEquals(hostScore2.getScore(), (1d-hostScore2.getRawScore()) / totalRawScore); +// +// // verify total of the normalized scores. +// assertEquals(1d, hostScore0.getScore() + hostScore1.getScore() + hostScore2.getScore()); +// +// // Arrange host scores in some perturbed order. +// final HostScore[] hostScores = new HostScore[] { hostScore2, +// hostScore0, hostScore1 }; +// +// // Sort by increasing normalized score (decreasing free capacity). +// Arrays.sort(hostScores); +// +// log.warn("hostScores[0]=" + hostScores[0]); +// log.warn("hostScores[1]=" + hostScores[1]); +// log.warn("hostScores[2]=" + hostScores[2]); +// +// // verify imposed ordering on (1-load). +// assertSameRef(hostScores[2], hostScore0); // most load (1-load = .533) +// assertSameRef(hostScores[1], hostScore1); // middle load (1-load = .333) +// assertSameRef(hostScores[0], hostScore2); // least load (1-load = .133) +// +// // Verify ordering (increasing normalized score). +// assertTrue(hostScores[0].getScore() < hostScores[1].getScore()); +// assertTrue(hostScores[1].getScore() < hostScores[2].getScore()); +// +// final double threshold0 = 0d; +// final double threshold1 = hostScores[0].getScore(); +// final double threshold2 = threshold1 + hostScores[1].getScore(); +// log.warn("threshold0=" + threshold0); +// log.warn("threshold1=" + threshold1); +// log.warn("threshold2=" + threshold2); +// +// { +// final HostScore actualHost = AbstractHostLBSPolicy.getHost( +// threshold0, hostScores); +// +// assertSameRef(hostScores[0], actualHost); +// } +// +// { +// final HostScore actualHost = AbstractHostLBSPolicy.getHost( +// (threshold1 - .001), hostScores); +// +// assertSameRef(hostScores[0], actualHost); +// } +// +// { +// final HostScore actualHost = AbstractHostLBSPolicy.getHost( +// threshold1, hostScores); +// +// assertSameRef(hostScores[1], actualHost); +// } +// +// { +// final HostScore actualHost = AbstractHostLBSPolicy.getHost( +// (threshold2 - .001), hostScores); +// +// assertSameRef(hostScores[1], actualHost); +// } +// +// { +// final HostScore actualHost = AbstractHostLBSPolicy.getHost( +// threshold2, hostScores); +// +// assertSameRef(hostScores[2], actualHost); +// } +// +// { +// final HostScore actualHost = AbstractHostLBSPolicy.getHost( +// 1d - .0001, hostScores); +// +// assertSameRef(hostScores[2], actualHost); +// } +// +// { +// try { +// AbstractHostLBSPolicy.getHost(1d, hostScores); +// } catch (IllegalArgumentException ex) { +// // ignore. +// if (log.isInfoEnabled()) +// log.info(ex); +// } +// } +// +// { +// try { +// AbstractHostLBSPolicy.getHost(-.00001d, hostScores); +// } catch (IllegalArgumentException ex) { +// // ignore. +// if (log.isInfoEnabled()) +// log.info(ex); +// } +// } +// +// // The services. +// final UUID A = UUID.randomUUID(); +// final UUID B = UUID.randomUUID(); +// final UUID C = UUID.randomUUID(); +// +// final ServiceScore serviceA = new ServiceScore(A, hostScore0.getHostname(), toRequestURI(hostScore0.getHostname())); +// final ServiceScore serviceB = new ServiceScore(B, hostScore1.getHostname(), toRequestURI(hostScore1.getHostname())); +// final ServiceScore serviceC = new ServiceScore(C, hostScore2.getHostname(), toRequestURI(hostScore2.getHostname())); +// +// /* +// * Now check the method to identify a specific joined service known to +// * be running on that host. +// */ +// { +// { +// +// // Run with a known seed. +// final Random rand = new Random(1L); +// +// final ServiceScore[] serviceScores = new ServiceScore[] { // +// serviceA // +// }; +// +// final ServiceScore actualService = AbstractHostLBSPolicy +// .getService(rand, hostScore0, serviceScores); +// +// assertTrue(actualService == serviceA); +// +// } +// +// { +// +// // Run with a known seed. +// final Random rand = new Random(1L); +// +// final ServiceScore[] serviceScores = new ServiceScore[] { // +// serviceA, serviceB, serviceC +// }; +// +// final ServiceScore actualService = AbstractHostLBSPolicy +// .getService(rand, hostScore0, serviceScores); +// +// assertTrue(actualService == serviceA); +// +// } +// +// } - /* - * Show scores. Decision is made on the *normalized* score. Since we - * want to assign work based on inverse load, "normalized" is defined as - * (1-load)/total - */ - log.warn("H1=" + hostScore0); - log.warn("H2=" + hostScore1); - log.warn("H3=" + hostScore2); - - // verify total of the raw scores. - assertEquals(totalRawScore, hostScore0.getRawScore() + hostScore1.getRawScore() - + hostScore2.getRawScore()); - - // verify individual normalized scores. - assertEquals(hostScore0.getScore(), (1d-hostScore0.getRawScore()) / totalRawScore); - assertEquals(hostScore1.getScore(), (1d-hostScore1.getRawScore()) / totalRawScore); - assertEquals(hostScore2.getScore(), (1d-hostScore2.getRawScore()) / totalRawScore); - - // verify total of the normalized scores. - assertEquals(1d, hostScore0.getScore() + hostScore1.getScore() + hostScore2.getScore()); - - // Arrange host scores in some perturbed order. - final HostScore[] hostScores = new HostScore[] { hostScore2, - hostScore0, hostScore1 }; - - // Sort by increasing normalized score (decreasing free capacity). - Arrays.sort(hostScores); - - log.warn("hostScores[0]=" + hostScores[0]); - log.warn("hostScores[1]=" + hostScores[1]); - log.warn("hostScores[2]=" + hostScores[2]); - - // verify imposed ordering on (1-load). - assertSameRef(hostScores[2], hostScore0); // most load (1-load = .533) - assertSameRef(hostScores[1], hostScore1); // middle load (1-load = .333) - assertSameRef(hostScores[0], hostScore2); // least load (1-load = .133) - - // Verify ordering (increasing normalized score). - assertTrue(hostScores[0].getScore() < hostScores[1].getScore()); - assertTrue(hostScores[1].getScore() < hostScores[2].getScore()); - - final double threshold0 = 0d; - final double threshold1 = hostScores[0].getScore(); - final double threshold2 = threshold1 + hostScores[1].getScore(); - log.warn("threshold0=" + threshold0); - log.warn("threshold1=" + threshold1); - log.warn("threshold2=" + threshold2); - - { - final HostScore actualHost = AbstractHostLBSPolicy.getHost( - threshold0, hostScores); - - assertSameRef(hostScores[0], actualHost); - } - - { - final HostScore actualHost = AbstractHostLBSPolicy.getHost( - (threshold1 - .001), hostScores); - - assertSameRef(hostScores[0], actualHost); - } - - { - final HostScore actualHost = AbstractHostLBSPolicy.getHost( - threshold1, hostScores); - - assertSameRef(hostScores[1], actualHost); - } - - { - final HostScore actualHost = AbstractHostLBSPolicy.getHost( - (threshold2 - .001), hostScores); - - assertSameRef(hostScores[1], actualHost); - } - - { - final HostScore actualHost = AbstractHostLBSPolicy.getHost( - threshold2, hostScores); - - assertSameRef(hostScores[2], actualHost); - } - - { - final HostScore actualHost = AbstractHostLBSPolicy.getHost( - 1d - .0001, hostScores); - - assertSameRef(hostScores[2], actualHost); - } - - { - try { - AbstractHostLBSPolicy.getHost(1d, hostScores); - } catch (IllegalArgumentException ex) { - // ignore. - if (log.isInfoEnabled()) - log.info(ex); - } - } - - { - try { - AbstractHostLBSPolicy.getHost(-.00001d, hostScores); - } catch (IllegalArgumentException ex) { - // ignore. - if (log.isInfoEnabled()) - log.info(ex); - } - } - - // The services. - final UUID A = UUID.randomUUID(); - final UUID B = UUID.randomUUID(); - final UUID C = UUID.randomUUID(); - - final ServiceScore serviceA = new ServiceScore(A, hostScore0.getHostname(), toRequestURI(hostScore0.getHostname())); - final ServiceScore serviceB = new ServiceScore(B, hostScore1.getHostname(), toRequestURI(hostScore1.getHostname())); - final ServiceScore serviceC = new ServiceScore(C, hostScore2.getHostname(), toRequestURI(hostScore2.getHostname())); - - /* - * Now check the method to identify a specific joined service known to - * be running on that host. - */ - { - { - - // Run with a known seed. - final Random rand = new Random(1L); - - final ServiceScore[] serviceScores = new ServiceScore[] { // - serviceA // - }; - - final ServiceScore actualService = AbstractHostLBSPolicy - .getService(rand, hostScore0, serviceScores); - - assertTrue(actualService == serviceA); - - } - - { - - // Run with a known seed. - final Random rand = new Random(1L); - - final ServiceScore[] serviceScores = new ServiceScore[] { // - serviceA, serviceB, serviceC - }; - - final ServiceScore actualService = AbstractHostLBSPolicy - .getService(rand, hostScore0, serviceScores); - - assertTrue(actualService == serviceA); - - } - - } - } /** 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:47:35
|
Revision: 8333 http://sourceforge.net/p/bigdata/code/8333 Author: thompsonbry Date: 2014-05-14 20:47:31 +0000 (Wed, 14 May 2014) Log Message: ----------- javadoc and code cleanup related to AVAILABILITY vs LOAD Modified Paths: -------------- 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/HostScore.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/lbs/TestAbstractHostLBSPolicy.java 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:38:50 UTC (rev 8332) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractHostLBSPolicy.java 2014-05-14 20:47:31 UTC (rev 8333) @@ -111,8 +111,8 @@ * * TODO In fact, we could automatically compute and use a reasonable * value based on the quorum size as - * <code>ceil((1/replicationFactor)-.05)</code>. With this approach, the - * local forward bias is automatic and has no more than a 5% deviation + * <code>ceil((1/replicationFactor)-.01)</code>. With this approach, the + * local forward bias is automatic and has no more than a 1% deviation * from the optimal decision if a round-robin is NOT being applied. */ String LOCAL_FORWARD_THRESHOLD = "localForwardThreshold"; @@ -670,7 +670,7 @@ if (log.isDebugEnabled()) log.debug("hostname=" + hostname + ", metrics=" - + metrics2[i] + ", score=" + hostScore.getScore()); + + metrics2[i] + ", score=" + hostScore.getAvailability()); } @@ -836,7 +836,7 @@ double sum = 0d; for (HostScore tmp : hostScores) { hostScore = tmp; - sum += hostScore.getScore(); + sum += hostScore.getAvailability(); if (sum >= d) { // found desired host. break; @@ -948,7 +948,7 @@ : hostTable.thisHost; if (thisHostScore != null - && thisHostScore.getScore() >= localForwardThresholdRef.get()) { + && thisHostScore.getAvailability() >= localForwardThresholdRef.get()) { servlet.forwardToLocalService(false/* isLeaderRequest */, request, response); 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 20:38:50 UTC (rev 8332) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/HostScore.java 2014-05-14 20:47:31 UTC (rev 8333) @@ -27,9 +27,11 @@ import com.bigdata.counters.AbstractStatisticsCollector; /** - * 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. + * Helper class pairs a hostname and the normalized availabilty for that host. + * The availability is based on (normalized) <code>1 - LOAD</code> for the host. + * The <code>LOAD</code> is computed using the {@link IHostMetrics} and an + * {@link IHostScoringRule} for computing the workload of a host from those + * metrics. The availability is then computed from the LOAD and normalized. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> */ @@ -43,63 +45,19 @@ */ private final boolean thisHost; -// /** -// * The raw score for some host. This is a measure of the load on a host. The -// * measure is computed based on {@link #metrics} using the -// * {@link #scoringRule}. -// */ -// private final double rawScore; - /** - * 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 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}). + * The normalized availability for the host. */ - private final double score; + private final double availability; -// /** -// * The {@link IHostScoringRule} used to convert the {@link #metrics} into -// * the {@link #rawScore}. -// */ -// private final IHostScoringRule scoringRule; -// -// /** -// * The {@link IHostMetrics} associated with this host (this is -// * informational. The {@link #metrics} provide the detailed per-host -// * performance metrics that were intepreted by the {@link #scoringRule} . -// */ -// final private IHostMetrics metrics; - -// /** The rank in [0:#scored]. This is an index into the Scores[]. */ -// public int rank = -1; -// -// /** The normalized double precision rank in [0.0:1.0]. */ -// public double drank = -1d; - -// /** -// * 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 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 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). + * Return the normalized availability for the host. Load balancing decision + * are based on this normalized {@link #getAvailability() score} (work is + * assigned to hosts in inverse proportion to the normalized load of the + * host). */ - public double getScore() { - return score; + public double getAvailability() { + return availability; } /** Return the hostname. */ @@ -107,23 +65,6 @@ return hostname; } -// /** -// * 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; -// } -// -// /** -// * The {@link IHostScoringRule} used to convert the {@link #getMetrics()} -// * into the {@link #getRawScore()} (optional). -// */ -// public IHostScoringRule getScoringRule() { -// return scoringRule; -// } - /** * Return <code>true</code> iff the host is this host. */ @@ -137,12 +78,7 @@ return "HostScore"// + "{hostname=" + hostname // + ", thisHost=" + thisHost// -// + ", rawScore=" + rawScore // - + ", score=" + score // -// + ", rank=" + rank // -// + ", drank=" + drank // -// + ", metrics=" + metrics // -// + ", scoringRule=" + scoringRule // + + ", availabilty=" + availability // + "}"; } @@ -151,25 +87,12 @@ * * @param hostname * The hostname (required, must be non-empty). - * @param score The normalized availability score for this - * host. -// * @param rawScore -// * The unnormalized load for that host. -// * @param totalRawScore -// * The total unnormalized load across all hosts. + * @param availability + * The normalized availability score for this host. */ -// * @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 score -// final double rawScore,// -// final double totalRawScore // -// final IHostMetrics metrics,// -// final IHostScoringRule scoringRule// + final double availability ) { if (hostname == null) @@ -178,28 +101,20 @@ if (hostname.trim().length() == 0) throw new IllegalArgumentException(); - if (score < 0d || score > 1d) + if (availability < 0d || availability > 1d) throw new IllegalArgumentException(); this.hostname = hostname; - this.score = score; + this.availability = availability; -// this.rawScore = rawScore; - this.thisHost = AbstractStatisticsCollector.fullyQualifiedHostName .equals(hostname); - -// this.scoringRule = scoringRule; -// -// this.metrics = metrics; -// score = normalize(rawScore, totalRawScore); - } /** - * Places elements into order by decreasing {@link #getScore() normalized + * Places elements into order by decreasing {@link #getAvailability() normalized * load}. The {@link #getHostname()} is used to break any ties. */ public final static Comparator<HostScore> COMPARE_BY_SCORE = new Comparator<HostScore>() { @@ -207,11 +122,11 @@ @Override public int compare(final HostScore t1, final HostScore t2) { - if (t1.score < t2.score) { + if (t1.availability < t2.availability) { return 1; - } else if (t1.score > t2.score) { + } else if (t1.availability > t2.availability) { return -1; Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/lbs/TestAbstractHostLBSPolicy.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/lbs/TestAbstractHostLBSPolicy.java 2014-05-14 20:38:50 UTC (rev 8332) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/lbs/TestAbstractHostLBSPolicy.java 2014-05-14 20:47:31 UTC (rev 8333) @@ -77,7 +77,7 @@ final HostScore hostScore1 = new HostScore("H1", 1d); // should sum to 1.0 - assertEquals(1d, hostScore1.getScore()); + assertEquals(1d, hostScore1.getAvailability()); final HostScore[] hostScores = new HostScore[] { // hostScore1 // This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-05-17 17:16:36
|
Revision: 8352 http://sourceforge.net/p/bigdata/code/8352 Author: thompsonbry Date: 2014-05-17 17:16:32 +0000 (Sat, 17 May 2014) Log Message: ----------- Further modifications to the NSS to start correctly with the embedded web app found along the classpath. This has been tested locally. We actually need to check different locations for eclipse and a deployed instance using a jar. See #939 (NSS class path) Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/health/TestNSSHealthCheck.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 2014-05-17 16:08:21 UTC (rev 8351) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 2014-05-17 17:16:32 UTC (rev 8352) @@ -176,7 +176,7 @@ * start from command line: bigdata-war/src not found </a> */ String JETTY_RESOURCE_BASE = "jetty.resourceBase"; - + } /** @@ -767,20 +767,74 @@ * jetty.resourceBase not declared in the environment. */ - // default location: TODO To DEFAULT_JETTY_RESOURCE_BASE - resourceBaseStr = "./bigdata-war/src"; + // The default location to check in the file system. + final File file = new File("bigdata-war/src"); final URL resourceBaseURL; - if (new File(resourceBaseStr).exists()) { + if (file.exists()) { // Check the file system. - resourceBaseURL = new URL("file:" + resourceBaseStr); + resourceBaseURL = new URL("file:" + file.getAbsolutePath()); isFile = true; } else { - // Check the classpath. - resourceBaseURL = classLoader.getResource(resourceBaseStr); + /* + * Check the classpath. + * + * Note: When checking the classpath we need to test different + * resources depending on whether we are running under the + * eclipse IDE or at the command line! + */ + URL tmp = null; + String src = null; + if (tmp == null) { + /** + * Eclipse IDE class path. + * + * Note: This is what gets found when running under eclipse. + * The URL will be in the configured build directory for the + * eclipse project. So, something like: + * + * <pre> + * file:/Users/bryan/Documents/workspace/BIGDATA_RELEASE_1_3_0_NEW_SVN/bin/WEB-INF/web.xml + * </pre> + */ + tmp = classLoader.getResource(src = "/WEB-INF/web.xml"); + } +// if (tmp == null)// Eclipse IDE class path (system class loader). +// tmp = ClassLoader.getSystemClassLoader().getResource( +// src = "WEB-INF/web.xml"); +// if (tmp == null) +// tmp = classLoader // JAR class path. +// .getResource(src = "/bigdata-war/src/WEB-INF/web.xml"); + if (tmp == null) { + /** + * JAR class path (system class loader). + * + * Note: This is what gets located when we run from the + * command line (outside of eclipse). The resulting JAR URL + * will be something like: + * + * <pre> + * jar:file:/Users/bryan/Documents/workspace/BIGDATA_RELEASE_1_3_0_NEW_SVN/ant-build/lib/bigdata-1.3.0-20140517.jar!/bigdata-war/src/WEB-INF/web.xml + * </pre> + */ + tmp = ClassLoader.getSystemClassLoader().getResource( + src = "bigdata-war/src/WEB-INF/web.xml"); + } + if (tmp != null) { + if (src != null) { + if (log.isInfoEnabled()) + log.info("Found: src=" + src + ", url=" + tmp); + } + final String s = tmp.toExternalForm(); + final int endIndex = s.lastIndexOf("WEB-INF/web.xml"); + final String t = s.substring(0, endIndex); + resourceBaseURL = new URL(t); + } else { + resourceBaseURL = null; + } isClassPath = resourceBaseURL != null; } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/health/TestNSSHealthCheck.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/health/TestNSSHealthCheck.java 2014-05-17 16:08:21 UTC (rev 8351) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/health/TestNSSHealthCheck.java 2014-05-17 17:16:32 UTC (rev 8352) @@ -615,6 +615,9 @@ // Setup test suite final Test test = createTestSuite(null/* name */, requestURI); + System.out.println("Running health check: Request-URI=" + + requestURI); + // Run the test suite. test.run(result); @@ -623,7 +626,8 @@ } final String msg = "nerrors=" + result.errorCount() + ", nfailures=" - + result.failureCount() + ", nrun=" + result.runCount(); + + result.failureCount() + ", nrun=" + result.runCount() + + " : Request-URI=" + requestURI; System.out.println(msg); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-06-03 14:40:48
|
Revision: 8441 http://sourceforge.net/p/bigdata/code/8441 Author: thompsonbry Date: 2014-06-03 14:40:41 +0000 (Tue, 03 Jun 2014) Log Message: ----------- Redefined the status code for the create of a pre-existing namespace operation as 409 (Conflict). Was previously 400 (Bad request). Redefined the status code for the success of the create namespace operation as 201 (Created). Was previously 200 (Ok). The REST API has been updated to make the expected status codes explicit (they were not previously specified). Updated the test suite to check the new status code for a pre-existing namespace. See #971 (Clarify HTTP Status codes for CREATE NAMESPACE operation) Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/MultiTenancyServlet.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestMultiTenancyAPI.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/MultiTenancyServlet.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/MultiTenancyServlet.java 2014-06-03 12:59:47 UTC (rev 8440) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/MultiTenancyServlet.java 2014-06-03 14:40:41 UTC (rev 8441) @@ -355,9 +355,12 @@ if (tripleStore != null) { /* - * Already exists. + * The namespace already exists. + * + * Note: The response code is defined as 409 (Conflict) since + * 1.3.2. */ - buildResponse(resp, HTTP_BADREQUEST, MIME_TEXT_PLAIN, + buildResponse(resp, HttpServletResponse.SC_CONFLICT, MIME_TEXT_PLAIN, "EXISTS: " + namespace); return; } @@ -395,12 +398,15 @@ } - buildResponse(resp, HTTP_OK, MIME_TEXT_PLAIN, "CREATED: " - + namespace); + /* + * Note: The response code is defined as 201 (Created) since 1.3.2. + */ + buildResponse(resp, HttpServletResponse.SC_CREATED, + MIME_TEXT_PLAIN, "CREATED: " + namespace); } catch (Throwable e) { - throw launderThrowable(e, resp, ""); + throw launderThrowable(e, resp, "namespace=" + namespace); } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestMultiTenancyAPI.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestMultiTenancyAPI.java 2014-06-03 12:59:47 UTC (rev 8440) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestMultiTenancyAPI.java 2014-06-03 14:40:41 UTC (rev 8441) @@ -10,6 +10,8 @@ import java.util.TreeMap; import java.util.UUID; +import javax.servlet.http.HttpServletResponse; + import org.openrdf.model.Graph; import org.openrdf.model.Literal; import org.openrdf.model.Resource; @@ -346,11 +348,11 @@ m_repo.createRepository(namespace2, properties); - fail("Expecting: " + BigdataServlet.HTTP_BADREQUEST); + fail("Expecting: " + HttpServletResponse.SC_CONFLICT); } catch (HttpException ex) { - assertEquals(BigdataServlet.HTTP_BADREQUEST, ex.getStatusCode()); + assertEquals(HttpServletResponse.SC_CONFLICT, ex.getStatusCode()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |