From: <tho...@us...> - 2011-01-15 22:49:46
|
Revision: 4105 http://bigdata.svn.sourceforge.net/bigdata/?rev=4105&view=rev Author: thompsonbry Date: 2011-01-15 22:49:40 +0000 (Sat, 15 Jan 2011) Log Message: ----------- Modified the thrown exception from IllegalArgumentException in RWStore#readData() to RuntimeException. This reflects the fact that the cause could be anything, including a ClosedByInterruptException which is most certainly not the result of an illegal argument. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java 2011-01-15 22:21:02 UTC (rev 4104) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java 2011-01-15 22:49:40 UTC (rev 4105) @@ -1435,12 +1435,14 @@ /* * Note: ClosedByInterruptException can be thrown out of * FileChannelUtility.readAll(), typically because the LIMIT on - * a query was satisified, but we do not want to log that as an + * a query was satisfied, but we do not want to log that as an * error. */ // log.error(e,e); - throw new IllegalArgumentException("Unable to read data", e); +// throw new IllegalArgumentException("Unable to read data: "+e, e); + throw new RuntimeException(e); + } } finally { readLock.unlock(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2011-04-19 15:42:09
|
Revision: 4418 http://bigdata.svn.sourceforge.net/bigdata/?rev=4418&view=rev Author: martyncutcher Date: 2011-04-19 15:42:03 +0000 (Tue, 19 Apr 2011) Log Message: ----------- rollback reopenChannel modification to avoid over synchronization Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java 2011-04-19 15:27:54 UTC (rev 4417) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java 2011-04-19 15:42:03 UTC (rev 4418) @@ -3160,35 +3160,56 @@ } - synchronized public FileChannel reopenChannel() throws IOException { + public FileChannel reopenChannel() throws IOException { - if (raf != null && raf.getChannel().isOpen()) { + /* + * Note: This is basically a double-checked locking pattern. It is + * used to avoid synchronizing when the backing channel is already + * open. + */ + { + final RandomAccessFile tmp = raf; + if (tmp != null) { + final FileChannel channel = tmp.getChannel(); + if (channel.isOpen()) { + // The channel is still open. + return channel; + } + } + } + + synchronized(this) { - /* - * The channel is still open. If you are allowing concurrent - * reads on the channel, then this could indicate that two - * readers each found the channel closed and that one was able - * to re-open the channel before the other such that the channel - * was open again by the time the 2nd reader got here. - */ + if (raf != null) { + final FileChannel channel = raf.getChannel(); + if (channel.isOpen()) { + /* + * The channel is still open. If you are allowing + * concurrent reads on the channel, then this could + * indicate that two readers each found the channel + * closed and that one was able to re-open the channel + * before the other such that the channel was open again + * by the time the 2nd reader got here. + */ + return channel; + } + } - return raf.getChannel(); + // open the file. + this.raf = new RandomAccessFile(file, mode); - } + // Update counters. + final StoreCounters<?> c = (StoreCounters<?>) storeCounters + .get().acquire(); + try { + c.nreopen++; + } finally { + c.release(); + } - // open the file. - this.raf = new RandomAccessFile(file, mode); + return raf.getChannel(); - // Update counters. - final StoreCounters<?> c = (StoreCounters<?>) storeCounters.get() - .acquire(); - try { - c.nreopen++; - } finally { - c.release(); - } - - return raf.getChannel(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2011-06-01 17:55:54
|
Revision: 4594 http://bigdata.svn.sourceforge.net/bigdata/?rev=4594&view=rev Author: martyncutcher Date: 2011-06-01 17:55:48 +0000 (Wed, 01 Jun 2011) Log Message: ----------- Generate PhysicalAddressResolutionException if address does not decode to a valid Allocator Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java 2011-06-01 16:54:41 UTC (rev 4593) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java 2011-06-01 17:55:48 UTC (rev 4594) @@ -2973,6 +2973,10 @@ private FixedAllocator getBlock(final int addr) { final int index = (-addr) >>> OFFSET_BITS; + + if (index >= m_allocs.size()) { + throw new PhysicalAddressResolutionException(addr); + } return m_allocs.get(index); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |