From: <dme...@us...> - 2014-05-21 09:12:41
|
Revision: 8389 http://sourceforge.net/p/bigdata/code/8389 Author: dmekonnen Date: 2014-05-21 09:12:36 +0000 (Wed, 21 May 2014) Log Message: ----------- Synching with BIGDATA_RELEASE_1_3_1 Modified Paths: -------------- branches/DEPLOYMENT_BRANCH_1_3_1/.classpath branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/BigdataStatics.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/Depends.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/AbstractStatisticsCollector.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/CounterSet.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/linux/PIDStatCollector.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/linux/SarCpuUtilizationCollector.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/linux/VMStatCollector.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/osx/IOStatCollector.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/osx/VMStatCollector.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/query/CounterSetBTreeSelector.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/query/CounterSetSelector.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/query/ICounterSelector.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/query/URLQueryModel.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/render/TextRenderer.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/render/XHTMLRenderer.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/render/XMLRenderer.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/search/DefaultAnalyzerFactory.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/test/com/bigdata/search/TestAll.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/test/com/bigdata/search/TestKeyBuilder.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/test/com/bigdata/search/TestPrefixSearch.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/test/com/bigdata/search/TestSearch.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/test/com/bigdata/search/TestSearchRestartSafe.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataEdge.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataElement.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataVertex.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-ganglia/build.properties branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-ganglia/src/java/com/bigdata/ganglia/GangliaService.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/jini/start/config/JiniCoreServicesConfiguration.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/jini/start/process/JiniCoreServicesProcessHelper.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-A.config branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-C.config branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestAll_LBS.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-A.properties branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/properties/PropertiesFormat.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/ArbitraryLengthPathNode.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/StaticAnalysis.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/StaticAnalysis_CanJoin.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/AST2BOpUtility.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/ServiceRegistry.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestAll.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestUnions.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/service/TestServiceRegistry.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/remote/BigdataSailRemoteRepository.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/remote/BigdataSailRemoteRepositoryConnection.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFServletContextListener.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/ConnegScore.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/ConnegUtil.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/CountersServlet.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HALoadBalancerServlet.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HAStatusServletUtil.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/RESTServlet.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/ConnectOptions.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/IPreparedQuery.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepositoryManager.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractLBSPolicy.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/HostScore.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/IHALoadBalancerPolicy.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/ServiceScore.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/NOPLBSPolicy.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/RoundRobinLBSPolicy.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/ganglia/DefaultHostScoringRule.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/ganglia/GangliaLBSPolicy.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/ganglia/LoadOneHostScoringRule.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/samples/com/bigdata/samples/NSSEmbeddedExample.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/test/com/bigdata/rdf/sail/tck/BigdataFederationSparqlTest.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/test/com/bigdata/rdf/sail/tck/BigdataSparqlTest.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestAll.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestAll2.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestConneg.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestMultiTenancyAPI.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlClient.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlClient2.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlServerWithProxyIndexManager2.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestProtocolAll.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestService794.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-war/src/WEB-INF/web.xml branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-war/src/html/css/style.css branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-war/src/html/index.html branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-war/src/html/js/workbench.js branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-war/src/jetty.xml branches/DEPLOYMENT_BRANCH_1_3_1/build.properties branches/DEPLOYMENT_BRANCH_1_3_1/build.xml branches/DEPLOYMENT_BRANCH_1_3_1/pom.xml branches/DEPLOYMENT_BRANCH_1_3_1/src/resources/HAJournal/HAJournal.config branches/DEPLOYMENT_BRANCH_1_3_1/src/resources/HAJournal/README branches/DEPLOYMENT_BRANCH_1_3_1/src/resources/bin/startHAServices branches/DEPLOYMENT_BRANCH_1_3_1/src/resources/etc/default/bigdataHA Modified: branches/DEPLOYMENT_BRANCH_1_3_1/.classpath =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/.classpath 2014-05-20 20:03:55 UTC (rev 8388) +++ branches/DEPLOYMENT_BRANCH_1_3_1/.classpath 2014-05-21 09:12:36 UTC (rev 8389) @@ -1,16 +1,19 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> + <classpathentry kind="src" path="bigdata/src/java"/> <classpathentry kind="src" path="bigdata-rdf/src/java"/> + <classpathentry kind="src" path="bigdata-sails/src/java"/> + <classpathentry kind="src" path="bigdata-blueprints/src/java"/> + <classpathentry kind="src" path="bigdata/src/test"/> + <classpathentry kind="src" path="bigdata-rdf/src/test"/> + <classpathentry kind="src" path="bigdata-sails/src/test"/> + <classpathentry kind="src" path="bigdata-blueprints/src/test"/> + <classpathentry kind="src" path="bigdata-war/src"/> + <classpathentry kind="src" path="bigdata/src/resources/logging"/> <classpathentry kind="src" path="bigdata-rdf/src/samples"/> <classpathentry kind="src" path="dsi-utils/src/java"/> - <classpathentry kind="src" path="bigdata/src/resources/logging"/> <classpathentry kind="src" path="bigdata-sails/src/samples"/> <classpathentry kind="src" path="bigdata-jini/src/test"/> - <classpathentry kind="src" path="bigdata-sails/src/java"/> - <classpathentry kind="src" path="bigdata/src/java"/> - <classpathentry kind="src" path="bigdata-rdf/src/test"/> - <classpathentry kind="src" path="bigdata/src/test"/> - <classpathentry kind="src" path="bigdata-sails/src/test"/> <classpathentry kind="src" path="bigdata-jini/src/java"/> <classpathentry kind="src" path="contrib/src/problems"/> <classpathentry kind="src" path="bigdata/src/samples"/> @@ -21,7 +24,6 @@ <classpathentry kind="src" path="junit-ext/src/java"/> <classpathentry kind="src" path="lgpl-utils/src/java"/> <classpathentry kind="src" path="lgpl-utils/src/test"/> - <classpathentry kind="src" path="bigdata-war/src"/> <classpathentry kind="src" path="bigdata-ganglia/src/java"/> <classpathentry kind="src" path="bigdata-ganglia/src/test"/> <classpathentry kind="src" path="bigdata-rdf/src/resources/service-providers"/> @@ -74,7 +76,7 @@ <classpathentry exported="true" kind="lib" path="bigdata-sails/lib/httpcomponents/commons-fileupload-1.2.2.jar"/> <classpathentry exported="true" kind="lib" path="bigdata-sails/lib/httpcomponents/commons-io-2.1.jar"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/apache/log4j-1.2.17.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/openrdf-sesame-2.6.10-onejar.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/openrdf-sesame-2.6.10-onejar.jar" sourcepath="/Users/bryan/Documents/workspace/org.openrdf.sesame-2.6.10"/> <classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/sesame-rio-testsuite-2.6.10.jar"/> <classpathentry exported="true" kind="lib" path="bigdata-sails/lib/sesame-sparql-testsuite-2.6.10.jar"/> <classpathentry exported="true" kind="lib" path="bigdata-sails/lib/sesame-store-testsuite-2.6.10.jar"/> @@ -86,11 +88,16 @@ <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-proxy-9.1.4.v20140401.jar" sourcepath="/Users/bryan/Downloads/org.eclipse.jetty.project-jetty-9.1.4.v20140401"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-rewrite-9.1.4.v20140401.jar"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-security-9.1.4.v20140401.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-server-9.1.4.v20140401.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-server-9.1.4.v20140401.jar" sourcepath="/Users/bryan/Downloads/org.eclipse.jetty.project-jetty-9.1.4.v20140401"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-servlet-9.1.4.v20140401.jar"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-util-9.1.4.v20140401.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-webapp-9.1.4.v20140401.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-webapp-9.1.4.v20140401.jar" sourcepath="/Users/bryan/Downloads/org.eclipse.jetty.project-jetty-9.1.4.v20140401"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-xml-9.1.4.v20140401.jar"/> <classpathentry exported="true" kind="lib" path="bigdata-sails/lib/jackson-core-2.2.3.jar"/> + <classpathentry kind="lib" path="bigdata-blueprints/lib/jettison-1.3.3.jar"/> + <classpathentry kind="lib" path="bigdata-blueprints/lib/blueprints-core-2.5.0.jar"/> + <classpathentry kind="lib" path="bigdata-blueprints/lib/blueprints-test-2.5.0.jar"/> + <classpathentry kind="lib" path="bigdata-blueprints/lib/rexster-core-2.5.0.jar"/> + <classpathentry kind="lib" path="bigdata-blueprints/lib/commons-configuration-1.10.jar"/> <classpathentry kind="output" path="bin"/> </classpath> Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/BigdataStatics.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/BigdataStatics.java 2014-05-20 20:03:55 UTC (rev 8388) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/BigdataStatics.java 2014-05-21 09:12:36 UTC (rev 8389) @@ -27,9 +27,6 @@ package com.bigdata; -import com.bigdata.counters.AbstractStatisticsCollector; -import com.bigdata.jini.start.process.ProcessHelper; - /** * A class for those few statics that it makes sense to reference from other * places. @@ -49,29 +46,31 @@ /** * The name of an environment variable whose value will be used as the * canoncial host name for the host running this JVM. This information is - * used by the {@link AbstractStatisticsCollector}, which is responsible for - * obtaining and reporting the canonical hostname for the {@link Banner} and - * other purposes. + * used by the {@link com.bigdata.counters.AbstractStatisticsCollector}, + * which is responsible for obtaining and reporting the canonical hostname + * for the {@link Banner} and other purposes. * - * @see AbstractStatisticsCollector - * @see Banner + * @see com.bigdata.counters.AbstractStatisticsCollector + * @see com.bigdata.Banner + * @see com.bigdata.ganglia.GangliaService#HOSTNAME * @see <a href="http://trac.bigdata.com/ticket/886" >Provide workaround for * bad reverse DNS setups</a> */ public static final String HOSTNAME = "com.bigdata.hostname"; - + /** * The #of lines of output from a child process which will be echoed onto * {@link System#out} when that child process is executed. This makes it * easy to track down why a child process dies during service start. If you * want to see all output from the child process, then you should set the - * log level for the {@link ProcessHelper} class to INFO. + * log level for the {@link com.bigdata.jini.start.process.ProcessHelper} + * class to INFO. * <p> - * Note: This needs to be more than the length of the {@link Banner} output - * in order for anything related to the process behavior to be echoed on - * {@link System#out}. + * Note: This needs to be more than the length of the + * {@link com.bigdata.Banner} output in order for anything related to the + * process behavior to be echoed on {@link System#out}. * - * @see ProcessHelper + * @see com.bigdata.jini.start.process.ProcessHelper */ public static int echoProcessStartupLineCount = 30;//Integer.MAX_VALUE;//100 Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/Depends.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/Depends.java 2014-05-20 20:03:55 UTC (rev 8388) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/Depends.java 2014-05-21 09:12:36 UTC (rev 8389) @@ -277,6 +277,10 @@ "https://github.com/tinkerpop/blueprints", "https://github.com/tinkerpop/blueprints/blob/master/LICENSE.txt"); + private final static Dep rexsterCore = new Dep("rexster-core", + "https://github.com/tinkerpop/rexster", + "https://github.com/tinkerpop/rexster/blob/master/LICENSE.txt"); + static private final Dep[] depends; static { depends = new Dep[] { // @@ -306,6 +310,7 @@ servletApi,// jacksonCore,// blueprintsCore,// + rexsterCore,// bigdataGanglia,// // scale-out jini,// Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/AbstractStatisticsCollector.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/AbstractStatisticsCollector.java 2014-05-20 20:03:55 UTC (rev 8388) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/AbstractStatisticsCollector.java 2014-05-21 09:12:36 UTC (rev 8389) @@ -137,6 +137,7 @@ * The interval in seconds at which the counter values are read from the * host platform. */ + @Override public int getInterval() { return interval; @@ -225,8 +226,15 @@ * <p> * Note: Subclasses MUST extend this method to initialize their own * counters. + * + * TODO Why does this use the older <code>synchronized</code> pattern with a + * shared {@link #countersRoot} object rather than returning a new object + * per request? Check assumptions in the scale-out and local journal code + * bases for this. */ - synchronized public CounterSet getCounters() { + @Override + synchronized + public CounterSet getCounters() { if (countersRoot == null) { @@ -319,6 +327,7 @@ serviceRoot.addCounter(IProcessCounters.Memory_runtimeFreeMemory, new Instrument<Long>() { + @Override public void sample() { setValue(Runtime.getRuntime().freeMemory()); } @@ -326,6 +335,7 @@ serviceRoot.addCounter(IProcessCounters.Memory_runtimeTotalMemory, new Instrument<Long>() { + @Override public void sample() { setValue(Runtime.getRuntime().totalMemory()); } @@ -599,6 +609,7 @@ * Start collecting host performance data -- must be extended by the * concrete subclass. */ + @Override public void start() { if (log.isInfoEnabled()) @@ -612,6 +623,7 @@ * Stop collecting host performance data -- must be extended by the concrete * subclass. */ + @Override public void stop() { if (log.isInfoEnabled()) @@ -634,6 +646,7 @@ final Thread t = new Thread() { + @Override public void run() { AbstractStatisticsCollector.this.stop(); Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/CounterSet.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/CounterSet.java 2014-05-20 20:03:55 UTC (rev 8388) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/CounterSet.java 2014-05-21 09:12:36 UTC (rev 8389) @@ -44,6 +44,8 @@ import org.apache.log4j.Logger; import org.xml.sax.SAXException; +import com.bigdata.util.StackInfoReport; + import cutthecrap.utils.striterators.Expander; import cutthecrap.utils.striterators.Filter; import cutthecrap.utils.striterators.IStriterator; @@ -87,7 +89,7 @@ */ public class CounterSet extends AbstractCounterSet implements ICounterSet { - static protected final Logger log = Logger.getLogger(CounterSet.class); + static private final Logger log = Logger.getLogger(CounterSet.class); // private String pathx; private final Map<String,ICounterNode> children = new ConcurrentHashMap<String,ICounterNode>(); @@ -107,7 +109,7 @@ * @param name * The name of the child. */ - private CounterSet(String name,CounterSet parent) { + private CounterSet(final String name, final CounterSet parent) { super(name,parent); @@ -159,6 +161,9 @@ // // } + /** + * Return <code>true</code> iff there are no children. + */ public boolean isLeaf() { return children.isEmpty(); @@ -216,7 +221,6 @@ } - @SuppressWarnings("unchecked") private void attach2(final ICounterNode src, final boolean replace) { if (src == null) @@ -286,7 +290,7 @@ } else { - ((Counter)src).parent = this; + ((Counter<?>)src).parent = this; } @@ -311,7 +315,8 @@ * @return The node -or- <code>null</code> if there is no node with that * path. */ - synchronized public ICounterNode detach(String path) { + @SuppressWarnings({ "rawtypes", "unchecked" }) + synchronized public ICounterNode detach(final String path) { final ICounterNode node = getPath(path); @@ -347,7 +352,7 @@ * @todo optimize for patterns that are anchored by filtering the child * {@link ICounterSet}. */ - @SuppressWarnings("unchecked") + @SuppressWarnings({ "unchecked", "rawtypes" }) public Iterator<ICounter> counterIterator(final Pattern filter) { final IStriterator src = new Striterator(directChildIterator( @@ -391,7 +396,7 @@ * * @return */ - @SuppressWarnings("unchecked") + @SuppressWarnings({ "unchecked", "rawtypes" }) public Iterator<ICounterNode> getNodes(final Pattern filter) { IStriterator src = ((IStriterator) postOrderIterator()) @@ -414,7 +419,8 @@ } - @SuppressWarnings("unchecked") + @Override + @SuppressWarnings({ "unchecked", "rawtypes" }) public Iterator<ICounter> getCounters(final Pattern filter) { IStriterator src = ((IStriterator) postOrderIterator()) @@ -450,8 +456,9 @@ * When <code>null</code> all directly attached children * (counters and counter sets) are visited. */ - public Iterator directChildIterator(boolean sorted, - Class<? extends ICounterNode> type) { + @SuppressWarnings("rawtypes") + public Iterator directChildIterator(final boolean sorted, + final Class<? extends ICounterNode> type) { /* * Note: In order to avoid concurrent modification problems under @@ -514,7 +521,7 @@ * child with a post-order traversal of its children and finally visits this * node itself. */ - @SuppressWarnings("unchecked") + @SuppressWarnings({ "rawtypes", "unchecked" }) public Iterator postOrderIterator() { /* @@ -531,6 +538,7 @@ * child with a pre-order traversal of its children and finally visits this * node itself. */ + @SuppressWarnings({ "rawtypes", "unchecked" }) public Iterator preOrderIterator() { /* @@ -562,7 +570,9 @@ /* * Expand each child in turn. */ - protected Iterator expand(Object childObj) { + @Override + @SuppressWarnings("rawtypes") + protected Iterator expand(final Object childObj) { /* * A child of this node. @@ -603,7 +613,9 @@ /* * Expand each child in turn. */ - protected Iterator expand(Object childObj) { + @Override + @SuppressWarnings("rawtypes") + protected Iterator expand(final Object childObj) { /* * A child of this node. @@ -624,7 +636,8 @@ } - public ICounterNode getChild(String name) { + @Override + public ICounterNode getChild(final String name) { if (name == null) throw new IllegalArgumentException(); @@ -642,6 +655,7 @@ * * @return The {@link CounterSet} described by the path. */ + @Override synchronized public CounterSet makePath(String path) { if (path == null) { @@ -740,6 +754,7 @@ * The object that is used to take the measurements from which * the counter's value will be determined. */ + @SuppressWarnings("rawtypes") synchronized public ICounter addCounter(final String path, final IInstrument instrument) { @@ -767,7 +782,7 @@ } - @SuppressWarnings("unchecked") + @SuppressWarnings({ "unchecked", "rawtypes" }) private ICounter addCounter2(final String name, final IInstrument instrument) { if (name == null) @@ -785,7 +800,7 @@ if(counter instanceof ICounter ) { // counter exists for that path. - log.error("Exists: path=" + getPath() + ", name=" + name); + log.error(new StackInfoReport("Exists: path=" + getPath() + ", name=" + name)); // return existing counter for path @todo vs replace. return (ICounter)counter; @@ -831,12 +846,14 @@ * * @throws IOException */ + @Override public void asXML(Writer w, Pattern filter) throws IOException { XMLUtility.INSTANCE.writeXML(this, w, filter); } + @Override public void readXML(final InputStream is, final IInstrumentFactory instrumentFactory, final Pattern filter) throws IOException, ParserConfigurationException, SAXException { Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/linux/PIDStatCollector.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/linux/PIDStatCollector.java 2014-05-20 20:03:55 UTC (rev 8388) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/linux/PIDStatCollector.java 2014-05-21 09:12:36 UTC (rev 8389) @@ -28,13 +28,12 @@ package com.bigdata.counters.linux; -import java.io.File; import java.io.IOException; -import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicLong; import com.bigdata.counters.AbstractProcessCollector; import com.bigdata.counters.AbstractProcessReader; @@ -61,7 +60,6 @@ * repeat forever if interval was specified. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public class PIDStatCollector extends AbstractProcessCollector implements ICounterHierarchy, IProcessCounters { @@ -92,7 +90,6 @@ * hierarchy. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ abstract class AbstractInst<T> implements IInstrument<T> { @@ -104,17 +101,19 @@ } - protected AbstractInst(String path) { + protected AbstractInst(final String path) { + + if (path == null) + throw new IllegalArgumentException(); - assert path != null; - this.path = path; } + @Override final public long lastModified() { - return lastModified; + return lastModified.get(); } @@ -122,7 +121,8 @@ * @throws UnsupportedOperationException * always. */ - final public void setValue(T value, long timestamp) { + @Override + final public void setValue(final T value, final long timestamp) { throw new UnsupportedOperationException(); @@ -135,13 +135,12 @@ * hierarchy. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ class IL extends AbstractInst<Long> { protected final long scale; - public IL(String path, long scale) { + public IL(final String path, final long scale) { super( path ); @@ -149,6 +148,7 @@ } + @Override public Long getValue() { final Long value = (Long) vals.get(path); @@ -170,13 +170,12 @@ * hierarchy. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ class ID extends AbstractInst<Double> { protected final double scale; - public ID(String path, double scale) { + public ID(final String path, final double scale) { super(path); @@ -184,6 +183,7 @@ } + @Override public Double getValue() { final Double value = (Double) vals.get(path); @@ -205,7 +205,7 @@ * as the last modified time for counters based on that process and * defaulted to the time that we begin to collect performance data. */ - private long lastModified = System.currentTimeMillis(); + private final AtomicLong lastModified = new AtomicLong(System.currentTimeMillis()); /** * Map containing the current values for the configured counters. The keys @@ -217,7 +217,7 @@ * declared within {@link #getCounters()} and not whatever path the counters * are eventually placed under within a larger hierarchy. */ - private Map<String,Object> vals = new HashMap<String, Object>(); + private final Map<String,Object> vals = new ConcurrentHashMap<String, Object>(); /** * @param pid @@ -229,7 +229,8 @@ * * @todo kernelVersion could be static. */ - public PIDStatCollector(int pid, int interval, KernelVersion kernelVersion) { + public PIDStatCollector(final int pid, final int interval, + final KernelVersion kernelVersion) { super(interval); @@ -269,79 +270,69 @@ command.add("-r"); // memory report // command.add("-w"); // context switching report (not implemented in our code). - - command.add(""+getInterval()); - + + command.add("" + getInterval()); + return command; } - /** - * Declare the counters that we will collect using <code>pidstat</code>. - * These counters are NOT placed within the counter hierarchy but are - * declared using the bare path for the counter. E.g., as - * {@link IProcessCounters#Memory_virtualSize}. - */ - /*synchronized*/ public CounterSet getCounters() { + @Override + public CounterSet getCounters() { -// if(root == null) { - - final CounterSet root = new CounterSet(); - - inst = new LinkedList<AbstractInst<?>>(); - - /* - * Note: Counters are all declared as Double to facilitate - * aggregation and scaling. - * - * Note: pidstat reports percentages as [0:100] so we normalize them - * to [0:1] using a scaling factor. - */ + final List<AbstractInst<?>> inst = new LinkedList<AbstractInst<?>>(); - inst.add(new ID(IProcessCounters.CPU_PercentUserTime,.01d)); - inst.add(new ID(IProcessCounters.CPU_PercentSystemTime,.01d)); - inst.add(new ID(IProcessCounters.CPU_PercentProcessorTime,.01d)); - - inst.add(new ID(IProcessCounters.Memory_minorFaultsPerSec,1d)); - inst.add(new ID(IProcessCounters.Memory_majorFaultsPerSec,1d)); - inst.add(new IL(IProcessCounters.Memory_virtualSize,Bytes.kilobyte)); - inst.add(new IL(IProcessCounters.Memory_residentSetSize,Bytes.kilobyte)); - inst.add(new ID(IProcessCounters.Memory_percentMemorySize,.01d)); + /* + * Note: Counters are all declared as Double to facilitate aggregation + * and scaling. + * + * Note: pidstat reports percentages as [0:100] so we normalize them to + * [0:1] using a scaling factor. + */ - /* - * Note: pidstat reports in kb/sec so we normalize to bytes/second - * using a scaling factor. - */ - inst.add(new ID(IProcessCounters.PhysicalDisk_BytesReadPerSec, Bytes.kilobyte32)); - inst.add(new ID(IProcessCounters.PhysicalDisk_BytesWrittenPerSec, Bytes.kilobyte32)); + inst.add(new ID(IProcessCounters.CPU_PercentUserTime, .01d)); + inst.add(new ID(IProcessCounters.CPU_PercentSystemTime, .01d)); + inst.add(new ID(IProcessCounters.CPU_PercentProcessorTime, .01d)); -// } + inst.add(new ID(IProcessCounters.Memory_minorFaultsPerSec, 1d)); + inst.add(new ID(IProcessCounters.Memory_majorFaultsPerSec, 1d)); + inst.add(new IL(IProcessCounters.Memory_virtualSize, Bytes.kilobyte)); + inst.add(new IL(IProcessCounters.Memory_residentSetSize, Bytes.kilobyte)); + inst.add(new ID(IProcessCounters.Memory_percentMemorySize, .01d)); + + /* + * Note: pidstat reports in kb/sec so we normalize to bytes/second using + * a scaling factor. + */ + inst.add(new ID(IProcessCounters.PhysicalDisk_BytesReadPerSec, + Bytes.kilobyte32)); + inst.add(new ID(IProcessCounters.PhysicalDisk_BytesWrittenPerSec, + Bytes.kilobyte32)); + + final CounterSet root = new CounterSet(); - for(Iterator<AbstractInst<?>> itr = inst.iterator(); itr.hasNext(); ) { - - final AbstractInst<?> i = itr.next(); - + for (AbstractInst<?> i : inst) { + root.addCounter(i.getPath(), i); - + } - + return root; - + } - private List<AbstractInst<?>> inst = null; -// private CounterSet root = null; - + /** - * Extended to force <code>pidstat</code> to use a consistent - * timestamp format regardless of locale by setting - * <code>S_TIME_FORMAT="ISO"</code> in the environment. + * Extended to force <code>pidstat</code> to use a consistent timestamp + * format regardless of locale by setting <code>S_TIME_FORMAT="ISO"</code> + * in the environment. */ - protected void setEnvironment(Map<String, String> env) { + @Override + protected void setEnvironment(final Map<String, String> env) { super.setEnvironment(env); - + env.put("S_TIME_FORMAT", "ISO"); - + } @Override @@ -374,10 +365,10 @@ * </pre> * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ protected class PIDStatReader extends ProcessReaderHelper { + @Override protected ActiveProcess getActiveProcess() { if (activeProcess == null) @@ -410,6 +401,7 @@ * is possible that this will not work when the host is * using an English locale. */ + @Override protected void readProcess() throws IOException, InterruptedException { if(log.isInfoEnabled()) @@ -478,7 +470,7 @@ * time of the start of the current day, which is what we would have * to do. */ - lastModified = System.currentTimeMillis(); + lastModified.set(System.currentTimeMillis()); if(header.contains("%CPU")) { Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/linux/SarCpuUtilizationCollector.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/linux/SarCpuUtilizationCollector.java 2014-05-20 20:03:55 UTC (rev 8388) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/linux/SarCpuUtilizationCollector.java 2014-05-21 09:12:36 UTC (rev 8389) @@ -28,12 +28,11 @@ package com.bigdata.counters.linux; -import java.io.File; -import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicLong; import com.bigdata.counters.AbstractProcessCollector; import com.bigdata.counters.AbstractProcessReader; @@ -51,31 +50,16 @@ * <code>sar -u</code>. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public class SarCpuUtilizationCollector extends AbstractProcessCollector implements ICounterHierarchy, IRequiredHostCounters, IHostCounters { -// static protected final Logger log = Logger -// .getLogger(SarCpuUtilizationCollector.class); -// -// /** -// * True iff the {@link #log} level is DEBUG or less. -// */ -// final protected static boolean DEBUG = log.isDebugEnabled(); -// -// /** -// * True iff the {@link #log} level is log.isInfoEnabled() or less. -// */ -// final protected static boolean log.isInfoEnabled() = log.isInfoEnabled(); - /** * Inner class integrating the current values with the {@link ICounterSet} * hierarchy. * * @author <a href="mailto:tho...@us...">Bryan * Thompson</a> - * @version $Id$ */ abstract class I<T> implements IInstrument<T> { @@ -87,17 +71,19 @@ } - public I(String path) { + public I(final String path) { - assert path != null; + if (path == null) + throw new IllegalArgumentException(); this.path = path; } + @Override public long lastModified() { - return lastModified; + return lastModified.get(); } @@ -105,7 +91,8 @@ * @throws UnsupportedOperationException * always. */ - public void setValue(T value, long timestamp) { + @Override + public void setValue(final T value, final long timestamp) { throw new UnsupportedOperationException(); @@ -117,13 +104,12 @@ * Double precision counter with scaling factor. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ class DI extends I<Double> { protected final double scale; - DI(String path, double scale) { + DI(final String path, final double scale) { super( path ); @@ -131,7 +117,7 @@ } - + @Override public Double getValue() { final Double value = (Double) vals.get(path); @@ -153,12 +139,12 @@ * keys are paths into the {@link CounterSet}. The values are the data * most recently read from <code>sar</code>. */ - private Map<String,Object> vals = new HashMap<String, Object>(); + private final Map<String,Object> vals = new ConcurrentHashMap<String, Object>(); /** * The timestamp associated with the most recently collected values. */ - private long lastModified = System.currentTimeMillis(); + private final AtomicLong lastModified = new AtomicLong(System.currentTimeMillis()); /** * @@ -173,6 +159,7 @@ } + @Override public List<String> getCommand() { final List<String> command = new LinkedList<String>(); @@ -192,53 +179,44 @@ } - /** - * Declares the counters that we will collect using <code>sar</code>. - */ - /*synchronized*/ public CounterSet getCounters() { + @Override + public CounterSet getCounters() { -// if(root == null) { - - final CounterSet root = new CounterSet(); - - inst = new LinkedList<I>(); - - /* - * Note: Counters are all declared as Double to facilitate - * aggregation. - * - * Note: sar reports percentages in [0:100] so we convert them to - * [0:1] using a scaling factor. - */ + final CounterSet root = new CounterSet(); - inst.add(new DI(IRequiredHostCounters.CPU_PercentProcessorTime,.01d)); - - inst.add(new DI(IHostCounters.CPU_PercentUserTime,.01d)); - inst.add(new DI(IHostCounters.CPU_PercentSystemTime,.01d)); - inst.add(new DI(IHostCounters.CPU_PercentIOWait,.01d)); - - for(Iterator<I> itr = inst.iterator(); itr.hasNext(); ) { - - final I i = itr.next(); - - root.addCounter(i.getPath(), i); - - } - -// } + @SuppressWarnings("rawtypes") + final List<I> inst = new LinkedList<I>(); + + /* + * Note: Counters are all declared as Double to facilitate aggregation. + * + * Note: sar reports percentages in [0:100] so we convert them to [0:1] + * using a scaling factor. + */ + + inst.add(new DI(IRequiredHostCounters.CPU_PercentProcessorTime, .01d)); + + inst.add(new DI(IHostCounters.CPU_PercentUserTime, .01d)); + inst.add(new DI(IHostCounters.CPU_PercentSystemTime, .01d)); + inst.add(new DI(IHostCounters.CPU_PercentIOWait, .01d)); + + for (@SuppressWarnings("rawtypes") I i : inst) { + + root.addCounter(i.getPath(), i); + + } return root; } - private List<I> inst = null; -// private CounterSet root = null; /** * Extended to force <code>sar</code> to use a consistent timestamp * format regardless of locale by setting * <code>S_TIME_FORMAT="ISO"</code> in the environment. */ - protected void setEnvironment(Map<String, String> env) { + @Override + protected void setEnvironment(final Map<String, String> env) { super.setEnvironment(env); @@ -246,6 +224,7 @@ } + @Override public AbstractProcessReader getProcessReader() { return new SarReader(); @@ -269,10 +248,10 @@ * * @author <a href="mailto:tho...@us...">Bryan * Thompson</a> - * @version $Id$ */ private class SarReader extends ProcessReaderHelper { + @Override protected ActiveProcess getActiveProcess() { if (activeProcess == null) @@ -376,7 +355,7 @@ * adjusting for the UTC time of the start of the current day, * which is what we would have to do. */ - lastModified = System.currentTimeMillis(); + lastModified.set(System.currentTimeMillis()); // final String user = data.substring(20-1, 30-1); //// final String nice = data.substring(30-1, 40-1); Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/linux/VMStatCollector.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/linux/VMStatCollector.java 2014-05-20 20:03:55 UTC (rev 8388) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/linux/VMStatCollector.java 2014-05-21 09:12:36 UTC (rev 8389) @@ -28,11 +28,11 @@ package com.bigdata.counters.linux; -import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicLong; import java.util.regex.Pattern; import com.bigdata.counters.AbstractProcessCollector; @@ -50,7 +50,6 @@ * Collects some counters using <code>vmstat</code>. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public class VMStatCollector extends AbstractProcessCollector implements ICounterHierarchy, IRequiredHostCounters, IHostCounters{ @@ -61,7 +60,6 @@ * * @author <a href="mailto:tho...@us...">Bryan * Thompson</a> - * @version $Id$ */ abstract class I<T> implements IInstrument<T> { @@ -73,17 +71,19 @@ } - public I(String path) { + public I(final String path) { - assert path != null; + if (path == null) + throw new IllegalArgumentException(); this.path = path; } + @Override public long lastModified() { - return lastModified; + return lastModified.get(); } @@ -91,7 +91,8 @@ * @throws UnsupportedOperationException * always. */ - public void setValue(T value, long timestamp) { + @Override + public void setValue(final T value, final long timestamp) { throw new UnsupportedOperationException(); @@ -108,15 +109,15 @@ protected final double scale; - DI(String path, double scale) { + DI(final String path, final double scale) { + + super(path); - super( path ); - this.scale = scale; } - + @Override public Double getValue() { final Double value = (Double) vals.get(path); @@ -138,24 +139,26 @@ * are paths into the {@link CounterSet}. The values are the data most * recently read from <code>vmstat</code>. */ - final private Map<String, Object> vals = new HashMap<String, Object>(); + final private Map<String, Object> vals = new ConcurrentHashMap<String, Object>(); /** * The timestamp associated with the most recently collected values. */ - private long lastModified = System.currentTimeMillis(); + private final AtomicLong lastModified = new AtomicLong( + System.currentTimeMillis()); /** * <code>true</code> iff you want collect the user time, system time, * and IO WAIT time using vmstat (as opposed to sar). */ - protected final boolean cpuStats; + private final boolean cpuStats; /** * The {@link Pattern} used to split apart the rows read from * <code>vmstat</code>. */ - final protected static Pattern pattern = Pattern.compile("\\s+"); + // Note: Exposed to the test suite. + final static Pattern pattern = Pattern.compile("\\s+"); /** * @@ -173,6 +176,7 @@ } + @Override public List<String> getCommand() { final List<String> command = new LinkedList<String>(); @@ -192,12 +196,12 @@ /** * Declares the counters that we will collect */ + @Override public CounterSet getCounters() { - final CounterSet root = new CounterSet(); + @SuppressWarnings("rawtypes") + final List<I> inst = new LinkedList<I>(); - inst = new LinkedList<I>(); - /* * Note: Counters are all declared as Double to facilitate aggregation. */ @@ -257,20 +261,19 @@ } - for (Iterator<I> itr = inst.iterator(); itr.hasNext();) { + final CounterSet root = new CounterSet(); - final I i = itr.next(); + for (@SuppressWarnings("rawtypes") I i : inst) { - root.addCounter(i.getPath(), i); + root.addCounter(i.getPath(), i); - } + } return root; } - private List<I> inst = null; - + @Override public AbstractProcessReader getProcessReader() { return new VMStatReader(); @@ -296,6 +299,7 @@ */ private class VMStatReader extends ProcessReaderHelper { + @Override protected ActiveProcess getActiveProcess() { if (activeProcess == null) @@ -317,7 +321,7 @@ if(log.isInfoEnabled()) log.info("begin"); - for(int i=0; i<10 && !getActiveProcess().isAlive(); i++) { + for (int i = 0; i < 10 && !getActiveProcess().isAlive(); i++) { if(log.isInfoEnabled()) log.info("waiting for the readerFuture to be set."); @@ -362,7 +366,7 @@ try { // timestamp - lastModified = System.currentTimeMillis(); + lastModified.set(System.currentTimeMillis()); final String[] fields = pattern.split(data.trim(), 0/* limit */); Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/osx/IOStatCollector.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/osx/IOStatCollector.java 2014-05-20 20:03:55 UTC (rev 8388) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/osx/IOStatCollector.java 2014-05-21 09:12:36 UTC (rev 8389) @@ -28,11 +28,11 @@ package com.bigdata.counters.osx; -import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicLong; import java.util.regex.Pattern; import com.bigdata.counters.AbstractProcessCollector; @@ -48,14 +48,13 @@ import com.bigdata.rawstore.Bytes; /** - * Collects some counters using <code>iostat</code>. Unfortunately, + * Collects some counters using <code>iostat</code> under OSX. Unfortunately, * <code>iostat</code> does not break down the reads and writes and does not * report IO Wait. This information is obviously available from OSX as it is * provided by the ActivityMonitor, but we can not get it from * <code>iostat</code>. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id: VMStatCollector.java 4289 2011-03-10 21:22:30Z thompsonbry $ */ public class IOStatCollector extends AbstractProcessCollector implements ICounterHierarchy, IRequiredHostCounters, IHostCounters{ @@ -77,7 +76,7 @@ } - public I(String path) { + public I(final String path) { assert path != null; @@ -85,9 +84,10 @@ } + @Override public long lastModified() { - return lastModified; + return lastModified.get(); } @@ -95,7 +95,8 @@ * @throws UnsupportedOperationException * always. */ - public void setValue(T value, long timestamp) { + @Override + public void setValue(final T value, final long timestamp) { throw new UnsupportedOperationException(); @@ -114,7 +115,7 @@ DI(final String path) { - this(path,1d); + this(path, 1d); } @@ -126,7 +127,7 @@ } - + @Override public Double getValue() { final Double value = (Double) vals.get(path); @@ -146,14 +147,14 @@ /** * Map containing the current values for the configured counters. The keys * are paths into the {@link CounterSet}. The values are the data most - * recently read from <code>vmstat</code>. + * recently read from <code>iostat</code>. */ - final private Map<String, Object> vals = new HashMap<String, Object>(); + final private Map<String, Object> vals = new ConcurrentHashMap<String, Object>(); /** * The timestamp associated with the most recently collected values. */ - private long lastModified = System.currentTimeMillis(); + private final AtomicLong lastModified = new AtomicLong(System.currentTimeMillis()); /** * The {@link Pattern} used to split apart the rows read from @@ -178,7 +179,8 @@ this.cpuStats = cpuStats; } - + + @Override public List<String> getCommand() { final List<String> command = new LinkedList<String>(); @@ -203,14 +205,13 @@ } - /** - * Declares the counters that we will collect - */ + @Override public CounterSet getCounters() { final CounterSet root = new CounterSet(); - inst = new LinkedList<I>(); + @SuppressWarnings("rawtypes") + final List<I> inst = new LinkedList<I>(); /* * Note: Counters are all declared as Double to facilitate aggregation. @@ -249,24 +250,22 @@ inst.add(new DI(IHostCounters.CPU_PercentUserTime, .01d)); // Note: column sy inst.add(new DI(IHostCounters.CPU_PercentSystemTime, .01d)); -// // Note: IO Wait is NOT reported by vmstat. +// // Note: IO Wait is NOT reported by iostat. // inst.add(new DI(IHostCounters.CPU_PercentIOWait, .01d)); } - for (Iterator<I> itr = inst.iterator(); itr.hasNext();) { + for (@SuppressWarnings("rawtypes") I i : inst) { - final I i = itr.next(); + root.addCounter(i.getPath(), i); - root.addCounter(i.getPath(), i); + } - } - return root; } - private List<I> inst = null; + @Override public AbstractProcessReader getProcessReader() { return new IOStatReader(); @@ -300,6 +299,7 @@ */ private class IOStatReader extends ProcessReaderHelper { + @Override protected ActiveProcess getActiveProcess() { if (activeProcess == null) @@ -427,7 +427,7 @@ try { // timestamp - lastModified = System.currentTimeMillis(); + lastModified.set(System.currentTimeMillis()); final String[] fields = pattern .split(data.trim(), 0/* limit */); Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/osx/VMStatCollector.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/osx/VMStatCollector.java 2014-05-20 20:03:55 UTC (rev 8388) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/counters/osx/VMStatCollector.java 2014-05-21 09:12:36 UTC (rev 8389) @@ -28,11 +28,11 @@ package com.bigdata.counters.osx; -import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicLong; import java.util.regex.Pattern; import com.bigdata.counters.AbstractProcessCollector; @@ -72,17 +72,19 @@ } - public I(String path) { - - assert path != null; - + public I(final String path) { + + if (path == null) + throw new IllegalArgumentException(); + this.path = path; } + @Override public long lastModified() { - return lastModified; + return lastModified.get(); } @@ -90,6 +92,7 @@ * @throws UnsupportedOperationException * always. */ + @Override public void setValue(T value, long timestamp) { throw new UnsupportedOperationException(); @@ -108,20 +111,20 @@ protected final double scale; DI(final String path) { - - this(path,1d); + this(path, 1d); + } DI(final String path, final double scale) { - - super( path ); - + + super(path); + this.scale = scale; - + } - - + + @Override public Double getValue() { final Double value = (Double) vals.get(path); @@ -143,12 +146,13 @@ * are paths into the {@link CounterSet}. The values are the data most * recently read from <code>vmstat</code>. */ - final private Map<String, Object> vals = new HashMap<String, Object>(); - + private final Map<String, Object> vals = new ConcurrentHashMap<String, Object>(); + /** * The timestamp associated with the most recently collected values. */ - private long lastModified = System.currentTimeMillis(); + private final AtomicLong lastModified = new AtomicLong( + System.currentTimeMillis()); /** * The {@link Pattern} used to split apart the rows read from @@ -166,7 +170,8 @@ super(interval); } - + + @Override public List<String> getCommand() { final List<String> command = new LinkedList<String>(); @@ -180,14 +185,13 @@ } - /** - * Declares the counters that we will collect - */ + @Override public CounterSet getCounters() { final CounterSet root = new CounterSet(); - inst = new LinkedList<I>(); + @SuppressWarnings("rawtypes") + final List<I> inst = new LinkedList<I>(); /* * Note: Counters are all declared as Double to facilitate aggregation. @@ -209,19 +213,17 @@ */ inst.add(new DI(IHostCounters.Memory_Bytes_Free)); - for (Iterator<I> itr = inst.iterator(); itr.hasNext();) { + for (@SuppressWarnin... [truncated message content] |