From: <tho...@us...> - 2011-06-02 13:10:27
|
Revision: 4601 http://bigdata.svn.sourceforge.net/bigdata/?rev=4601&view=rev Author: thompsonbry Date: 2011-06-02 13:10:20 +0000 (Thu, 02 Jun 2011) Log Message: ----------- Code cleanup and javadoc Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/io/writecache/WriteCache.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/journal/AbstractTask.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/journal/TemporaryStoreFactory.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/io/writecache/TestWriteCache.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/io/writecache/WriteCache.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/io/writecache/WriteCache.java 2011-06-02 12:52:57 UTC (rev 4600) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/io/writecache/WriteCache.java 2011-06-02 13:10:20 UTC (rev 4601) @@ -1076,13 +1076,16 @@ } - /** - * Locks - * @return - * @throws InterruptedException - * @throws IllegalStateException - */ - public String checkdata() throws IllegalStateException, InterruptedException { + /** + * Debug routine logs @ ERROR additional information when a checksum error + * has been encountered. + * + * @return An informative error message. + * + * @throws InterruptedException + * @throws IllegalStateException + */ + private String checkdata() throws IllegalStateException, InterruptedException { if (!useChecksum) { return "Unable to check since checksums are not enabled"; @@ -1094,8 +1097,9 @@ int nrecords = recordMap.size(); for (Entry<Long, RecordMetadata> ent : recordMap.entrySet()) { - RecordMetadata md = ent.getValue(); + final RecordMetadata md = ent.getValue(); + // length of the record w/o checksum field. final int reclen = md.recordLength - 4; Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/journal/AbstractTask.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/journal/AbstractTask.java 2011-06-02 12:52:57 UTC (rev 4600) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/journal/AbstractTask.java 2011-06-02 13:10:20 UTC (rev 4601) @@ -2271,13 +2271,13 @@ } /* - * Overriden methods for registering or dropping indices. + * Overridden methods for registering or dropping indices. */ /** * Delegates to the {@link AbstractTask}. */ - public void dropIndex(String name) { + public void dropIndex(final String name) { AbstractTask.this.dropIndex(name); @@ -2656,7 +2656,7 @@ } @SuppressWarnings("unchecked") - public ReadOnlyJournal(AbstractJournal source) { + public ReadOnlyJournal(final AbstractJournal source) { if (source == null) throw new IllegalArgumentException(); @@ -2666,7 +2666,7 @@ /* * Setup a locator for resources. Resources that correspond to * indices declared by the task are accessible via the task itself. - * Other resources are assessible via the locator on the underlying + * Other resources are accessible via the locator on the underlying * journal. When the journal is part of a federation, that locator * will be the federation's locator. */ @@ -2679,7 +2679,7 @@ } /* - * Index access methods (overriden or disallowed depending on what they + * Index access methods (overridden or disallowed depending on what they * do). */ Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/journal/TemporaryStoreFactory.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/journal/TemporaryStoreFactory.java 2011-06-02 12:52:57 UTC (rev 4600) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/journal/TemporaryStoreFactory.java 2011-06-02 13:10:20 UTC (rev 4601) @@ -50,14 +50,13 @@ */ public class TemporaryStoreFactory { - protected static final transient Logger log = Logger + private static final transient Logger log = Logger .getLogger(TemporaryStoreFactory.class); /** * Configuration options for the {@link TemporaryStoreFactory}. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public interface Options { Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/io/writecache/TestWriteCache.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/io/writecache/TestWriteCache.java 2011-06-02 12:52:57 UTC (rev 4600) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/io/writecache/TestWriteCache.java 2011-06-02 13:10:20 UTC (rev 4601) @@ -107,15 +107,14 @@ // The buffer size must be at least 1k for these tests. assertTrue(DirectBufferPool.INSTANCE.getBufferCapacity() >= Bytes.kilobyte32); - WriteCache writeCache = new WriteCache.FileChannelWriteCache(0, buf, + final WriteCache writeCache = new WriteCache.FileChannelWriteCache(0, buf, true, isHighlyAvailable, false, opener); - - long addr1 = 0; - long addr2 = 12800; - long addr3 = 24800; - ByteBuffer data1 = getRandomData(512); - int chk1 = ChecksumUtility.threadChk.get().checksum(data1, 0/* offset */, data1.limit()); + final long addr1 = 0; + final long addr2 = 12800; + final long addr3 = 24800; + final ByteBuffer data1 = getRandomData(512); + final int chk1 = ChecksumUtility.threadChk.get().checksum(data1, 0/* offset */, data1.limit()); writeCache.write(addr1, data1, chk1); data1.flip(); @@ -131,8 +130,9 @@ fail("Expected ChecksumError"); } catch (ChecksumError ce) { - System.out.println("Expected: " + ce.getMessage()); - } + if (log.isInfoEnabled()) + log.info("Expected: " + ce.getMessage()); + } } finally { DirectBufferPool.INSTANCE.release(buf); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |