From: <sa...@us...> - 2004-03-01 12:21:39
|
Update of /cvsroot/jrobin/src/org/jrobin/graph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20110/org/jrobin/graph Modified Files: Grapher.java RrdGraph.java Log Message: Improved RrdDbPool, removed bug in Grapher (RRD files were never closed or returned to the pool) Index: Grapher.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/graph/Grapher.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Grapher.java 15 Jan 2004 22:24:30 -0000 1.6 --- Grapher.java 1 Mar 2004 12:02:46 -0000 1.7 *************** *** 307,311 **** // Get the rrdDb src = (FetchSource) fetchSources.next(); ! rrd = rrdGraph.getRrd( src.getRrdFile() ); // If the endtime is 0, use the last time a database was updated --- 307,312 ---- // Get the rrdDb src = (FetchSource) fetchSources.next(); ! String rrdFile = src.getRrdFile(); ! rrd = rrdGraph.getRrd( rrdFile ); // If the endtime is 0, use the last time a database was updated *************** *** 321,325 **** ve = src.fetch( rrd, startTime, endTime ); varList = ve.getNames(); ! for (int i= 0; i < varList.length; i++) { sources[tblPos] = new Def(varList[i], numPoints); --- 322,329 ---- ve = src.fetch( rrd, startTime, endTime ); varList = ve.getNames(); ! ! // BUGFIX: Release the rrdDb ! rrdGraph.releaseRrd(rrd); ! for (int i= 0; i < varList.length; i++) { sources[tblPos] = new Def(varList[i], numPoints); Index: RrdGraph.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/graph/RrdGraph.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RrdGraph.java 20 Nov 2003 20:56:32 -0000 1.3 --- RrdGraph.java 1 Mar 2004 12:02:46 -0000 1.4 *************** *** 383,387 **** return new RrdDb( rrdFile ); } ! // ================================================================ // -- Private methods --- 383,396 ---- return new RrdDb( rrdFile ); } ! ! void releaseRrd(RrdDb rrdDb) throws RrdException, IOException { ! if(pool != null) { ! pool.release(rrdDb); ! } ! else { ! rrdDb.close(); ! } ! } ! // ================================================================ // -- Private methods |