From: <tho...@us...> - 2010-12-14 17:15:17
|
Revision: 4009 http://bigdata.svn.sourceforge.net/bigdata/?rev=4009&view=rev Author: thompsonbry Date: 2010-12-14 17:15:11 +0000 (Tue, 14 Dec 2010) Log Message: ----------- Added Option to RWStore to disable the double buffering of writes. Modified Paths: -------------- branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java Modified: branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java =================================================================== --- branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java 2010-12-14 17:06:17 UTC (rev 4008) +++ branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java 2010-12-14 17:15:11 UTC (rev 4009) @@ -285,6 +285,16 @@ String DEFAULT_FREE_BITS_THRESHOLD = "300"; + /** + * When <code>true</code>, scattered writes which are strictly ascending + * will be coalesced within a buffer and written out as a single IO + * (default {@value #DEFAULT_DOUBLE_BUFFER_WRITES}). This improves write + * performance for SATA, SAS, and even SSD. + */ + String DOUBLE_BUFFER_WRITES = RWStore.class.getName() + ".doubleBuffer"; + + String DEFAULT_DOUBLE_BUFFER_WRITES = "true"; + } /* @@ -594,10 +604,16 @@ } catch (IOException e1) { throw new RuntimeException(e1); } - - try { - m_bufferedWrite = new BufferedWrite(this); - } catch (InterruptedException e1) { + + if (Boolean.valueOf(fileMetadata.getProperty( + Options.DOUBLE_BUFFER_WRITES, + Options.DEFAULT_DOUBLE_BUFFER_WRITES))) { + try { + m_bufferedWrite = new BufferedWrite(this); + } catch (InterruptedException e1) { + m_bufferedWrite = null; + } + } else { m_bufferedWrite = null; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |