From: <tho...@us...> - 2013-02-06 01:07:43
|
Revision: 6890 http://bigdata.svn.sourceforge.net/bigdata/?rev=6890&view=rev Author: thompsonbry Date: 2013-02-06 01:07:30 +0000 (Wed, 06 Feb 2013) Log Message: ----------- Merging from dev branch to READ_CACHE branch to capture changes in the development branch. See [1] for the previous merge from the development branch to the READ_CACHE branch (which captured the delta from r6766 to r6857 of /branches/BIGDATA_RELEASE_1_2_0). {{{ At revision 6889. (Before doing the merge) merge https://bigdata.svn.sourceforge.net/svnroot/bigdata/branches/BIGDATA_RELEASE_1_2_0 /Users/bryan/Documents/workspace/BIGDATA_READ_CACHE_HEAD --- Merging r6857 through r6889 into /Users/bryan/Documents/workspace/BIGDATA_READ_CACHE_HEAD Merge complete. ===== File Statistics: ===== Deleted: 4 Added: 5 Updated: 43 No conflicts. }}} [1] https://sourceforge.net/apps/trac/bigdata/ticket/621 (Coalesce write cache records and install reads in cache) Revision Links: -------------- http://bigdata.svn.sourceforge.net/bigdata/?rev=6766&view=rev http://bigdata.svn.sourceforge.net/bigdata/?rev=6857&view=rev http://bigdata.svn.sourceforge.net/bigdata/?rev=6889&view=rev http://bigdata.svn.sourceforge.net/bigdata/?rev=6857&view=rev http://bigdata.svn.sourceforge.net/bigdata/?rev=6889&view=rev Modified Paths: -------------- branches/READ_CACHE/bigdata/src/java/com/bigdata/bop/solutions/SolutionSetStream.java branches/READ_CACHE/bigdata/src/java/com/bigdata/io/writecache/WriteCacheService.java branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/AbstractBufferStrategy.java branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/AbstractJournal.java branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/AbstractTask.java branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/DiskBackedBufferStrategy.java branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/DiskOnlyStrategy.java branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/IAtomicStore.java branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/IBufferStrategy.java branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/JournalDelegate.java branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/RWStrategy.java branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/WORMStrategy.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/AbstractRawStore.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IRawStore.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/Allocator.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/FixedAllocator.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/IAllocationManager.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/IRWStrategy.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/IStore.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/PSOutputStream.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/RWStore.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/sector/AllocationContext.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/sector/IMemoryManager.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/sector/MemStore.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/sector/MemStrategy.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/sector/MemoryManager.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/sector/PSInputStream.java branches/READ_CACHE/bigdata/src/java/com/bigdata/stream/Stream.java branches/READ_CACHE/bigdata/src/test/com/bigdata/btree/TestRawRecords.java branches/READ_CACHE/bigdata/src/test/com/bigdata/btree/TestRemoveAll.java branches/READ_CACHE/bigdata/src/test/com/bigdata/journal/TestNamedIndices.java branches/READ_CACHE/bigdata/src/test/com/bigdata/journal/TestWORMStrategy.java branches/READ_CACHE/bigdata/src/test/com/bigdata/rawstore/AbstractRawStoreTestCase.java branches/READ_CACHE/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java branches/READ_CACHE/bigdata/src/test/com/bigdata/rwstore/sector/TestMemoryManager.java branches/READ_CACHE/bigdata/src/test/com/bigdata/rwstore/sector/TestMemoryManagerStreams.java branches/READ_CACHE/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/AST2BOpUtility.java branches/READ_CACHE/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/optimizers/ASTAttachJoinFiltersOptimizer.java branches/READ_CACHE/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/optimizers/AbstractJoinGroupOptimizer.java branches/READ_CACHE/bigdata-rdf/src/java/com/bigdata/rdf/store/AbstractTripleStore.java branches/READ_CACHE/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java branches/READ_CACHE/bigdata-sails/src/test/org/openrdf/query/parser/sparql/ComplexSPARQLQueryTest.java Added Paths: ----------- branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IAllocationContext.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IAllocationManagerStore.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IPSOutputStream.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IStreamStore.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/RawStoreDelegate.java Removed Paths: ------------- branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/IAllocationContext.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/IAllocationManagerStore.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/IPSOutputStream.java branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/IStreamStore.java Property Changed: ---------------- branches/READ_CACHE/ branches/READ_CACHE/bigdata/lib/jetty/ branches/READ_CACHE/bigdata/src/java/com/bigdata/bop/aggregate/ branches/READ_CACHE/bigdata/src/java/com/bigdata/bop/joinGraph/ branches/READ_CACHE/bigdata/src/java/com/bigdata/bop/util/ branches/READ_CACHE/bigdata/src/java/com/bigdata/htree/raba/ branches/READ_CACHE/bigdata/src/java/com/bigdata/jsr166/ branches/READ_CACHE/bigdata/src/test/com/bigdata/bop/joinGraph/ branches/READ_CACHE/bigdata/src/test/com/bigdata/bop/util/ branches/READ_CACHE/bigdata/src/test/com/bigdata/jsr166/ branches/READ_CACHE/bigdata/src/test/com/bigdata/util/httpd/ branches/READ_CACHE/bigdata-compatibility/ branches/READ_CACHE/bigdata-jini/src/java/com/bigdata/attr/ branches/READ_CACHE/bigdata-jini/src/java/com/bigdata/disco/ branches/READ_CACHE/bigdata-jini/src/java/com/bigdata/util/config/ branches/READ_CACHE/bigdata-perf/ branches/READ_CACHE/bigdata-perf/btc/ branches/READ_CACHE/bigdata-perf/btc/src/resources/ branches/READ_CACHE/bigdata-perf/lubm/ branches/READ_CACHE/bigdata-perf/uniprot/ branches/READ_CACHE/bigdata-perf/uniprot/src/ branches/READ_CACHE/bigdata-rdf/src/java/com/bigdata/bop/rdf/aggregate/ branches/READ_CACHE/bigdata-rdf/src/java/com/bigdata/rdf/changesets/ branches/READ_CACHE/bigdata-rdf/src/java/com/bigdata/rdf/error/ branches/READ_CACHE/bigdata-rdf/src/java/com/bigdata/rdf/internal/ branches/READ_CACHE/bigdata-rdf/src/java/com/bigdata/rdf/relation/ branches/READ_CACHE/bigdata-rdf/src/java/com/bigdata/rdf/util/ branches/READ_CACHE/bigdata-rdf/src/samples/ branches/READ_CACHE/bigdata-rdf/src/test/com/bigdata/bop/rdf/aggregate/ branches/READ_CACHE/bigdata-rdf/src/test/com/bigdata/rdf/internal/ branches/READ_CACHE/bigdata-rdf/src/test/com/bigdata/rdf/relation/ branches/READ_CACHE/bigdata-sails/src/java/com/bigdata/rdf/sail/bench/ branches/READ_CACHE/bigdata-sails/src/java/com/bigdata/rdf/sail/changesets/ branches/READ_CACHE/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/ branches/READ_CACHE/bigdata-sails/src/test/com/bigdata/rdf/sail/bench/ branches/READ_CACHE/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/ branches/READ_CACHE/dsi-utils/ branches/READ_CACHE/dsi-utils/LEGAL/ branches/READ_CACHE/dsi-utils/lib/ branches/READ_CACHE/dsi-utils/src/ branches/READ_CACHE/dsi-utils/src/java/ branches/READ_CACHE/dsi-utils/src/java/it/ branches/READ_CACHE/dsi-utils/src/java/it/unimi/ branches/READ_CACHE/dsi-utils/src/test/ branches/READ_CACHE/dsi-utils/src/test/it/unimi/ branches/READ_CACHE/dsi-utils/src/test/it/unimi/dsi/ branches/READ_CACHE/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom/ branches/READ_CACHE/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom/ branches/READ_CACHE/osgi/ branches/READ_CACHE/src/resources/bin/config/ Property changes on: branches/READ_CACHE ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BIGDATA_OPENRDF_2_6_9_UPDATE:6769-6785 /branches/BIGDATA_RELEASE_1_2_0:6766-6857 /branches/BTREE_BUFFER_BRANCH:2004-2045 /branches/DEV_BRANCH_27_OCT_2009:2270-2546,2548-2782 /branches/INT64_BRANCH:4486-4522 /branches/JOURNAL_HA_BRANCH:2596-4066 /branches/LARGE_LITERALS_REFACTOR:4175-4387 /branches/LEXICON_REFACTOR_BRANCH:2633-3304 /branches/QUADS_QUERY_BRANCH:4525-4531,4550-4584,4586-4609,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 /branches/RWSTORE_1_1_0_DEBUG:5896-5935 /branches/TIDS_PLUS_BLOBS_BRANCH:4814-4836 /branches/bugfix-btm:2594-3237 /branches/dev-btm:2574-2730 /branches/fko:3150-3194 /trunk:3392-3437,3656-4061 + /branches/BIGDATA_OPENRDF_2_6_9_UPDATE:6769-6785 /branches/BIGDATA_RELEASE_1_2_0:6766-6889 /branches/BTREE_BUFFER_BRANCH:2004-2045 /branches/DEV_BRANCH_27_OCT_2009:2270-2546,2548-2782 /branches/INT64_BRANCH:4486-4522 /branches/JOURNAL_HA_BRANCH:2596-4066 /branches/LARGE_LITERALS_REFACTOR:4175-4387 /branches/LEXICON_REFACTOR_BRANCH:2633-3304 /branches/QUADS_QUERY_BRANCH:4525-4531,4550-4584,4586-4609,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 /branches/RWSTORE_1_1_0_DEBUG:5896-5935 /branches/TIDS_PLUS_BLOBS_BRANCH:4814-4836 /branches/bugfix-btm:2594-3237 /branches/dev-btm:2574-2730 /branches/fko:3150-3194 /trunk:3392-3437,3656-4061 Property changes on: branches/READ_CACHE/bigdata/lib/jetty ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/lib/jetty:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/lib/jetty:6766-6857 /branches/INT64_BRANCH/bigdata/lib/jetty:4486-4522 /branches/QUADS_QUERY_BRANCH/bigdata/lib/jetty:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 /branches/RWSTORE_1_1_0_DEBUG/bigdata/lib/jetty:5896-5935 /branches/TIDS_PLUS_BLOBS_BRANCH/bigdata/lib/jetty:4814-4836 + /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/lib/jetty:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/lib/jetty:6766-6889 /branches/INT64_BRANCH/bigdata/lib/jetty:4486-4522 /branches/QUADS_QUERY_BRANCH/bigdata/lib/jetty:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 /branches/RWSTORE_1_1_0_DEBUG/bigdata/lib/jetty:5896-5935 /branches/TIDS_PLUS_BLOBS_BRANCH/bigdata/lib/jetty:4814-4836 Property changes on: branches/READ_CACHE/bigdata/src/java/com/bigdata/bop/aggregate ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/java/com/bigdata/bop/aggregate:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/bop/aggregate:6766-6857 /branches/INT64_BRANCH/bigdata/src/java/com/bigdata/bop/aggregate:4486-4522 /branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/aggregate:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 /branches/RWSTORE_1_1_0_DEBUG/bigdata/src/java/com/bigdata/bop/aggregate:5896-5935 /branches/TIDS_PLUS_BLOBS_BRANCH/bigdata/src/java/com/bigdata/bop/aggregate:4814-4836 + /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/java/com/bigdata/bop/aggregate:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/bop/aggregate:6766-6889 /branches/INT64_BRANCH/bigdata/src/java/com/bigdata/bop/aggregate:4486-4522 /branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/aggregate:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 /branches/RWSTORE_1_1_0_DEBUG/bigdata/src/java/com/bigdata/bop/aggregate:5896-5935 /branches/TIDS_PLUS_BLOBS_BRANCH/bigdata/src/java/com/bigdata/bop/aggregate:4814-4836 Property changes on: branches/READ_CACHE/bigdata/src/java/com/bigdata/bop/joinGraph ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/java/com/bigdata/bop/joinGraph:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/bop/joinGraph:6766-6857 /branches/INT64_BRANCH/bigdata/src/java/com/bigdata/bop/joinGraph:4486-4522 /branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/joinGraph:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 /branches/RWSTORE_1_1_0_DEBUG/bigdata/src/java/com/bigdata/bop/joinGraph:5896-5935 /branches/TIDS_PLUS_BLOBS_BRANCH/bigdata/src/java/com/bigdata/bop/joinGraph:4814-4836 + /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/java/com/bigdata/bop/joinGraph:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/bop/joinGraph:6766-6889 /branches/INT64_BRANCH/bigdata/src/java/com/bigdata/bop/joinGraph:4486-4522 /branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/joinGraph:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 /branches/RWSTORE_1_1_0_DEBUG/bigdata/src/java/com/bigdata/bop/joinGraph:5896-5935 /branches/TIDS_PLUS_BLOBS_BRANCH/bigdata/src/java/com/bigdata/bop/joinGraph:4814-4836 Modified: branches/READ_CACHE/bigdata/src/java/com/bigdata/bop/solutions/SolutionSetStream.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/bop/solutions/SolutionSetStream.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/bop/solutions/SolutionSetStream.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -44,12 +44,12 @@ import com.bigdata.btree.Checkpoint; import com.bigdata.btree.IndexMetadata; import com.bigdata.io.SerializerUtil; +import com.bigdata.rawstore.IPSOutputStream; import com.bigdata.rawstore.IRawStore; import com.bigdata.rdf.internal.encoder.SolutionSetStreamDecoder; import com.bigdata.rdf.internal.encoder.SolutionSetStreamEncoder; import com.bigdata.rdf.sparql.ast.ISolutionSetStats; import com.bigdata.rdf.sparql.ast.SolutionSetStats; -import com.bigdata.rwstore.IPSOutputStream; import com.bigdata.stream.Stream; import com.bigdata.striterator.Chunkerator; import com.bigdata.striterator.ICloseableIterator; Property changes on: branches/READ_CACHE/bigdata/src/java/com/bigdata/bop/util ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/java/com/bigdata/bop/util:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/bop/util:6766-6857 /branches/INT64_BRANCH/bigdata/src/java/com/bigdata/bop/util:4486-4522 /branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/util:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 /branches/RWSTORE_1_1_0_DEBUG/bigdata/src/java/com/bigdata/bop/util:5896-5935 /branches/TIDS_PLUS_BLOBS_BRANCH/bigdata/src/java/com/bigdata/bop/util:4814-4836 + /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/java/com/bigdata/bop/util:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/bop/util:6766-6889 /branches/INT64_BRANCH/bigdata/src/java/com/bigdata/bop/util:4486-4522 /branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/util:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 /branches/RWSTORE_1_1_0_DEBUG/bigdata/src/java/com/bigdata/bop/util:5896-5935 /branches/TIDS_PLUS_BLOBS_BRANCH/bigdata/src/java/com/bigdata/bop/util:4814-4836 Property changes on: branches/READ_CACHE/bigdata/src/java/com/bigdata/htree/raba ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/java/com/bigdata/htree/raba:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/htree/raba:6766-6857 /branches/INT64_BRANCH/bigdata/src/java/com/bigdata/htree/raba:4486-4522 /branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/htree/raba:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 /branches/RWSTORE_1_1_0_DEBUG/bigdata/src/java/com/bigdata/htree/raba:5896-5935 /branches/TIDS_PLUS_BLOBS_BRANCH/bigdata/src/java/com/bigdata/htree/raba:4814-4836 + /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/java/com/bigdata/htree/raba:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/htree/raba:6766-6889 /branches/INT64_BRANCH/bigdata/src/java/com/bigdata/htree/raba:4486-4522 /branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/htree/raba:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 /branches/RWSTORE_1_1_0_DEBUG/bigdata/src/java/com/bigdata/htree/raba:5896-5935 /branches/TIDS_PLUS_BLOBS_BRANCH/bigdata/src/java/com/bigdata/htree/raba:4814-4836 Modified: branches/READ_CACHE/bigdata/src/java/com/bigdata/io/writecache/WriteCacheService.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/io/writecache/WriteCacheService.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/io/writecache/WriteCacheService.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -401,14 +401,14 @@ * * Toggle comment appropriately to activate/deactivate */ -// final long[] addrsUsed = new long[4024 * 1024]; -// int addrsUsedCurs = 0; -// final char[] addrActions = new char[addrsUsed.length]; -// final int[] addrLens = new int[addrsUsed.length]; - private final long[] addrsUsed = null; - private int addrsUsedCurs = 0; - private final char[] addrActions = null; - private final int[] addrLens = null; + // final long[] addrsUsed = new long[4024 * 1024]; + // private int addrsUsedCurs = 0; + // final char[] addrActions = new char[addrsUsed.length]; + // final int[] addrLens = new int[addrsUsed.length]; + private final long[] addrsUsed = null; + private int addrsUsedCurs = 0; + private final char[] addrActions = null; + private final int[] addrLens = null; /** * The backing reader that can be used when a cache read misses. Modified: branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/AbstractBufferStrategy.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/AbstractBufferStrategy.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/AbstractBufferStrategy.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -23,7 +23,11 @@ */ package com.bigdata.journal; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.EOFException; import java.io.IOException; +import java.io.InputStream; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; @@ -38,6 +42,8 @@ import com.bigdata.mdi.IResourceMetadata; import com.bigdata.rawstore.AbstractRawWormStore; import com.bigdata.rawstore.Bytes; +import com.bigdata.rawstore.IAllocationContext; +import com.bigdata.rawstore.IPSOutputStream; import com.bigdata.rawstore.IRawStore; import com.bigdata.rawstore.WormAddressManager; import com.bigdata.resources.ResourceManager; @@ -180,6 +186,9 @@ */ final protected AtomicLong nextOffset; + /** The WORM address of the last committed allocation. */ + final protected AtomicLong commitOffset; + static final NumberFormat cf; static { @@ -269,6 +278,8 @@ this.nextOffset = new AtomicLong(nextOffset); + this.commitOffset = new AtomicLong(nextOffset); + this.bufferMode = bufferMode; this.open = true; @@ -601,17 +612,34 @@ } - /** The default is a NOP. */ + /** + * {@inheritDoc} + * <p> + * This implementation checks the current allocation offset with that in the + * rootBlock + * + * @return true if store has been modified since last commit() + */ @Override - public void commit() { + public boolean isDirty() { - // NOP for WORM. + return commitOffset.get() != nextOffset.get(); + } - /** The default is a NOP. */ + @Override + public void commit() { + + // remember offset at commit + commitOffset.set(nextOffset.get()); + + } + + @Override public void abort() { - // NOP + // restore the last committed value for nextOffset. + nextOffset.set(commitOffset.get()); } Modified: branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/AbstractJournal.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/AbstractJournal.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/AbstractJournal.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -29,6 +29,7 @@ import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.lang.ref.WeakReference; import java.net.InetSocketAddress; import java.nio.ByteBuffer; @@ -127,12 +128,14 @@ import com.bigdata.quorum.Quorum; import com.bigdata.quorum.QuorumActor; import com.bigdata.quorum.QuorumMember; +import com.bigdata.rawstore.IAllocationContext; +import com.bigdata.rawstore.IAllocationManagerStore; +import com.bigdata.rawstore.IPSOutputStream; import com.bigdata.rawstore.IRawStore; import com.bigdata.rawstore.SimpleMemoryRawStore; import com.bigdata.rawstore.WormAddressManager; import com.bigdata.relation.locator.IResourceLocator; import com.bigdata.resources.ResourceManager; -import com.bigdata.rwstore.IAllocationContext; import com.bigdata.rwstore.IAllocationManager; import com.bigdata.rwstore.IRWStrategy; import com.bigdata.rwstore.sector.MemStrategy; @@ -212,7 +215,7 @@ * been asynchronously closed. */ public abstract class AbstractJournal implements IJournal/* , ITimestampService */ -, IAllocationManager +, IAllocationManager, IAllocationManagerStore { /** @@ -2422,6 +2425,7 @@ } + @Override public void abort() { final WriteLock lock = _fieldReadWriteLock.writeLock(); @@ -2685,6 +2689,14 @@ // */ // abstract public AbstractLocalTransactionManager getLocalTransactionManager(); + @Override + public boolean isDirty() { + + return _bufferStrategy.isDirty(); + + } + + @Override public long commit() { final ILocalTransactionManager transactionManager = getLocalTransactionManager(); @@ -3265,6 +3277,36 @@ } + @Override + public IPSOutputStream getOutputStream() { + assertCanWrite(); + + return _bufferStrategy.getOutputStream(); + } + + @Override + public IPSOutputStream getOutputStream(final IAllocationContext context) { + + assertCanWrite(); + + if (_bufferStrategy instanceof IRWStrategy) { + + return ((IRWStrategy) _bufferStrategy).getOutputStream(context); + + } else { + + return _bufferStrategy.getOutputStream(); + + } + + } + + @Override + public InputStream getInputStream(long addr) { + return _bufferStrategy.getInputStream(addr); + } + + // Note: NOP for WORM. Used by RW for eventual recycle protocol. public void delete(final long addr) { @@ -5977,5 +6019,4 @@ return removed; } - } Modified: branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/AbstractTask.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/AbstractTask.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/AbstractTask.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -29,6 +29,7 @@ import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.nio.ByteBuffer; import java.util.Arrays; import java.util.HashMap; @@ -64,6 +65,8 @@ import com.bigdata.concurrent.NonBlockingLockManager; import com.bigdata.counters.CounterSet; import com.bigdata.mdi.IResourceMetadata; +import com.bigdata.rawstore.IAllocationContext; +import com.bigdata.rawstore.IPSOutputStream; import com.bigdata.relation.locator.DefaultResourceLocator; import com.bigdata.relation.locator.ILocatableResource; import com.bigdata.relation.locator.IResourceLocator; @@ -71,7 +74,6 @@ import com.bigdata.resources.ResourceManager; import com.bigdata.resources.StaleLocatorException; import com.bigdata.resources.StaleLocatorReason; -import com.bigdata.rwstore.IAllocationContext; import com.bigdata.rwstore.IRWStrategy; import com.bigdata.rwstore.IRawTx; import com.bigdata.sparse.GlobalRowStoreHelper; @@ -2660,7 +2662,18 @@ // return delegate.write(data, oldAddr, this); // } - public void delete(final long addr) { + + @Override + public IPSOutputStream getOutputStream() { + return delegate.getOutputStream(this); + } + + @Override + public InputStream getInputStream(long addr) { + return delegate.getInputStream(addr); + } + + public void delete(final long addr) { delegate.delete(addr, this); } @@ -2708,6 +2721,11 @@ throw new UnsupportedOperationException(); } + @Override + public boolean isDirty() { + return delegate.isDirty(); + } + } // class IsolatatedActionJournal /** @@ -3155,6 +3173,20 @@ return delegate.getHttpdPort(); } + @Override + public IPSOutputStream getOutputStream() { + throw new UnsupportedOperationException(); + } + + @Override + public InputStream getInputStream(long addr) { + return delegate.getInputStream(addr); + } + + @Override + public boolean isDirty() { + return false; // it's readOnly - cannot be dirty + } } // class ReadOnlyJournal /** Modified: branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/DiskBackedBufferStrategy.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/DiskBackedBufferStrategy.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/DiskBackedBufferStrategy.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -25,12 +25,15 @@ import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; import com.bigdata.io.FileChannelUtility; import com.bigdata.io.IReopenChannel; +import com.bigdata.rawstore.IAllocationContext; +import com.bigdata.rawstore.IPSOutputStream; /** * Abstract base class for implementations that use a direct buffer as a write @@ -430,4 +433,5 @@ public void setNextOffset(long lastOffset) { // void for default DiskBackedBufferStrategy } + } Modified: branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/DiskOnlyStrategy.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/DiskOnlyStrategy.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/DiskOnlyStrategy.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -485,11 +485,12 @@ */ @Override public void commit() { - if (writeCache != null) { - synchronized(this) { - flushWriteCache(); - } - } + if (writeCache != null) { + synchronized (this) { + flushWriteCache(); + } + } + super.commit(); } /** Modified: branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/IAtomicStore.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/IAtomicStore.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/IAtomicStore.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -62,6 +62,15 @@ public long commit(); /** + * Return <code>true</code> if the store has been modified since the last + * {@link #commit()} or {@link #abort()}. + * + * @return true if store has been modified since last {@link #commit()} or + * {@link #abort()}. + */ + public boolean isDirty(); + + /** * Set a persistence capable data structure for callback during the commit * protocol. * <p> Modified: branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/IBufferStrategy.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/IBufferStrategy.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/IBufferStrategy.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -231,6 +231,15 @@ public void abort(); /** + * Return <code>true</code> if the store has been modified since the last + * {@link #commit()} or {@link #abort()}. + * + * @return true if store has been modified since last {@link #commit()} or + * {@link #abort()}. + */ + public boolean isDirty(); + + /** * The RWStrategy requires meta allocation info in the root block, this * method is the hook to enable access. The metaStartAddr is the address in * the file where the allocation blocks are stored. Modified: branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/JournalDelegate.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/JournalDelegate.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/JournalDelegate.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -25,6 +25,7 @@ package com.bigdata.journal; import java.io.File; +import java.io.InputStream; import java.nio.ByteBuffer; import java.util.Iterator; import java.util.Properties; @@ -39,6 +40,8 @@ import com.bigdata.btree.IndexMetadata; import com.bigdata.counters.CounterSet; import com.bigdata.mdi.IResourceMetadata; +import com.bigdata.rawstore.IAllocationContext; +import com.bigdata.rawstore.IPSOutputStream; import com.bigdata.relation.locator.IResourceLocator; import com.bigdata.sparse.SparseRowStore; @@ -269,4 +272,19 @@ public Iterator<String> indexNameScan(String prefix, long timestamp) { return delegate.indexNameScan(prefix, timestamp); } + + @Override + public IPSOutputStream getOutputStream() { + return delegate.getOutputStream(); + } + + @Override + public InputStream getInputStream(long addr) { + return delegate.getInputStream(addr); + } + + @Override + public boolean isDirty() { + return delegate.isDirty(); + } } Modified: branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/RWStrategy.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/RWStrategy.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/RWStrategy.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -48,8 +48,8 @@ import com.bigdata.quorum.Quorum; import com.bigdata.rawstore.AbstractRawStore; import com.bigdata.rawstore.IAddressManager; -import com.bigdata.rwstore.IAllocationContext; -import com.bigdata.rwstore.IPSOutputStream; +import com.bigdata.rawstore.IAllocationContext; +import com.bigdata.rawstore.IPSOutputStream; import com.bigdata.rwstore.IRWStrategy; import com.bigdata.rwstore.IRawTx; import com.bigdata.rwstore.RWStore; @@ -446,6 +446,7 @@ /** * Calls through to store and then to WriteCacheService.reset */ + @Override public void abort() { m_store.reset(); @@ -569,7 +570,18 @@ } - public long getMetaBitsAddr() { + /** + * Supports protocol in BigdataSailConnection to check for modifications + * prior to calling rollback(). + * + * @return true if store has been modified since last commit() + */ + @Override + public boolean isDirty() { + return m_store.requiresCommit(); + } + + public long getMetaBitsAddr() { return m_store.getMetaBitsAddr(); Modified: branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/WORMStrategy.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/WORMStrategy.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/journal/WORMStrategy.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -23,14 +23,19 @@ */ package com.bigdata.journal; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.EOFException; import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.channels.Channel; import java.nio.channels.FileChannel; import java.security.DigestException; import java.security.MessageDigest; +import java.util.ArrayList; import java.util.Map; import java.util.UUID; import java.util.concurrent.Future; @@ -63,6 +68,8 @@ import com.bigdata.io.writecache.WriteCacheCounters; import com.bigdata.io.writecache.WriteCacheService; import com.bigdata.quorum.Quorum; +import com.bigdata.rawstore.IAllocationContext; +import com.bigdata.rawstore.IPSOutputStream; import com.bigdata.rawstore.IRawStore; import com.bigdata.util.ChecksumError; import com.bigdata.util.ChecksumUtility; @@ -1152,9 +1159,11 @@ } + super.commit(); + } - @Override + @Override public long getBlockSequence() { return lastBlockSequence; @@ -1172,6 +1181,8 @@ @Override public void abort() { + super.abort(); + if (writeCacheService != null) { try { if (quorum != null) { @@ -1196,7 +1207,7 @@ throw new RuntimeException(e); } } - + } /** @@ -2549,7 +2560,9 @@ @Override public void resetFromHARootBlock(final IRootBlockView rootBlock) { - nextOffset.set(rootBlock.getNextOffset()); + final long rbNextOffset = rootBlock.getNextOffset(); + nextOffset.set(rbNextOffset); + commitOffset.set(rbNextOffset); } @@ -2653,7 +2666,6 @@ } } - @Override public void writeRawBuffer(HARebuildRequest req, IHAWriteMessage msg, ByteBuffer transfer) throws IOException { Property changes on: branches/READ_CACHE/bigdata/src/java/com/bigdata/jsr166 ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/java/com/bigdata/jsr166:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/jsr166:6766-6857 /branches/INT64_BRANCH/bigdata/src/java/com/bigdata/jsr166:4486-4522 /branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/jsr166:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 /branches/RWSTORE_1_1_0_DEBUG/bigdata/src/java/com/bigdata/jsr166:5896-5935 /branches/TIDS_PLUS_BLOBS_BRANCH/bigdata/src/java/com/bigdata/jsr166:4814-4836 + /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/java/com/bigdata/jsr166:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/jsr166:6766-6889 /branches/INT64_BRANCH/bigdata/src/java/com/bigdata/jsr166:4486-4522 /branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/jsr166:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 /branches/RWSTORE_1_1_0_DEBUG/bigdata/src/java/com/bigdata/jsr166:5896-5935 /branches/TIDS_PLUS_BLOBS_BRANCH/bigdata/src/java/com/bigdata/jsr166:4814-4836 Modified: branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/AbstractRawStore.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/AbstractRawStore.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/AbstractRawStore.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -27,6 +27,10 @@ package com.bigdata.rawstore; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStream; import java.nio.ByteBuffer; import com.bigdata.LRUNexus; @@ -78,30 +82,233 @@ // NOP. } -// public void delete(long addr, IAllocationContext context) { -// delete(addr); -// } -// -// public long write(ByteBuffer data, IAllocationContext context) { -// return write(data); -// } -// -// public long write(ByteBuffer data, long oldAddr, IAllocationContext context) { -// return write(data, oldAddr); -// } -// -// /** -// * The default implementation is a NOP. -// */ -// public void detachContext(IAllocationContext context) { -// // NOP -// } -// -// /** -// * The default implementation is a NOP. -// */ -// public void abortContext(final IAllocationContext context) { -// // NOP -// } - + @Override + public IPSOutputStream getOutputStream() { + // TODO: implement an optional pooled object creation + // to allow re-use of streams (with their buffers). + // see ticket:#641 + return new WORMOutputStream(); + } + + @Override + public InputStream getInputStream(long addr) { + return new WORMInputStream(addr); + } + + // WORM_STREAM_BUFFER_SIZE as used by Output and Input streams + static final int WORM_STREAM_BUFFER_SIZE = 16 * 1024; + + /** + * WORMOutputStream + * <p> + * This implements a buffered allocation that may be split + * across muliple smaller allocations, thus providing a scalable + * approach for concurrent allocations of very large amounts + * of data without needing single large buffers for the full + * amount. + * <p> + * The stream address may be interpreted differently from a normal + * allocation in that the data size is associated with the total data + * stored across all stream allocations. Thus an address returned by + * a stream must only ever be used to retrieve an input stream. + * <p> + * This is different from the RWStore where the BLOB allocation mechanism + * uses streams internally and therefore the addressing mechanism is + * compatible with external stream usage. + * <p> + * Note that an address returned from getAddr() is the negative of the + * normal storage address, differentiating a stream address from a + * conventional allocation. + */ + class WORMOutputStream extends IPSOutputStream { + final private byte[] m_buffer = new byte[WORM_STREAM_BUFFER_SIZE]; + private int m_cursor = 0; + + private int m_bytesWritten = 0; + + private boolean m_open = true; // open on creation + + private ByteArrayOutputStream m_hdrData = null; + private DataOutputStream m_header = null; + + @Override + public long getAddr() { + if (!m_open) + throw new IllegalStateException(); + + m_open = false; + + if (m_cursor == 0) + return 0; // no content is fine for a stream + + final ByteBuffer bb = ByteBuffer.wrap(m_buffer, 0, m_cursor); + + final long addr = AbstractRawStore.this.write(bb); + + m_bytesWritten += m_cursor; + + if (m_header == null) + return addr; // return conventional address since no header is required + + // handle blob stream header + try { + m_header.writeLong(addr); + } catch (IOException e) { + throw new RuntimeException(e); + } + + + // write stream header + final ByteBuffer hbb = ByteBuffer.wrap(m_hdrData.toByteArray()); + final long hdrAddr = AbstractRawStore.this.write(hbb); + + final IAddressManager am = getAddressManager(); + + // return a stream address indicating the total size of the data and the address + // of the header data. + // + // the negative address indicates that this is a stream header and cannot be + // processed as a contiguous allocation. + // + // FIXME: enable standard non-stream read to process streamed data similarly to + // RWStore BLOB handling. + return -am.toAddr(m_bytesWritten, am.getOffset(hdrAddr)); + } + + @Override + public void write(int b) throws IOException { + // check threshold write + if (m_cursor == WORM_STREAM_BUFFER_SIZE) { + final ByteBuffer bb = ByteBuffer.wrap(m_buffer); + final long waddr = AbstractRawStore.this.write(bb); + if (m_header == null) { + m_hdrData = new ByteArrayOutputStream(); + m_header = new DataOutputStream(m_hdrData); + } + m_header.writeLong(waddr); + m_cursor = 0; + m_bytesWritten += WORM_STREAM_BUFFER_SIZE; + } + + m_buffer[m_cursor++] = (byte) b; + } + + /**************************************************************** + * write byte array to the buffer + * + * we need to be able to efficiently handle large arrays beyond size + * of the blobThreshold, so + **/ + public void write(final byte b[], final int off, final int len) throws IOException { + + if (!m_open) { + throw new IllegalStateException("Already written"); + } + + if ((m_cursor + len) > WORM_STREAM_BUFFER_SIZE) { + // not optimal, but this will include a disk write anyhow so who cares + for (int i = 0; i < len; i++) { + write(b[off+i]); + } + } else { + System.arraycopy(b, off, m_buffer, m_cursor, len); + + m_cursor += len; + + } + } + } + + /** + * The WORMInputStream is returned by the getInputStream + * method. + * + * + */ + class WORMInputStream extends InputStream { + + final private ByteBuffer m_hbb; + private ByteBuffer m_bb; + + WORMInputStream(final long stream_addr) { +// if (stream_addr > 0) { +// throw new IllegalArgumentException("Address: " + stream_addr + " was not returned from a stream"); +// } + + // if negative then is a stream header + final boolean isStream = stream_addr < 0; + + // convert back to original allocation adress + final long addr = isStream ? -stream_addr : stream_addr; + + final IAddressManager am = getAddressManager(); + + final int nbytes = am.getByteCount(addr); + + // Stream could have + if (isStream && nbytes != 0 && nbytes < WORM_STREAM_BUFFER_SIZE) + throw new IllegalArgumentException("Stream Address for unexpected data length: " + nbytes); + + // check for stream header + if (isStream) { + // handle overspill + final int nblocks = (nbytes + (WORM_STREAM_BUFFER_SIZE-1)) / WORM_STREAM_BUFFER_SIZE; + + m_hbb = AbstractRawStore.this.read(am.toAddr(nblocks * 8, am.getOffset(addr))); // 8 bytes size of long + + // read first block + assert m_hbb.hasRemaining(); + m_bb = AbstractRawStore.this.read(m_hbb.getLong()); + } else { + m_hbb = null; + + if (nbytes > 0) + m_bb = AbstractRawStore.this.read(addr); + else + m_bb = ByteBuffer.allocate(0); + } + } + + @Override + public int read() throws IOException { + if (!m_bb.hasRemaining() && m_hbb != null && m_hbb.hasRemaining()) { + m_bb = AbstractRawStore.this.read(m_hbb.getLong()); + } + + if (!m_bb.hasRemaining()) + return -1; + + // return unsigned byte as int + return 0xFF & m_bb.get(); + } + + public synchronized int read(final byte dst[], final int off, final int len) throws IOException { + if (m_bb.remaining() >= len) { + m_bb.get(dst, off, len); + return len; + } + int cursor = 0; + + final int len1 = m_bb.remaining(); + m_bb.get(dst, off, len1); + cursor += len1; + + while (m_hbb != null && m_hbb.hasRemaining()) { + m_bb = AbstractRawStore.this.read(m_hbb.getLong()); + + final int len2 = len - cursor; + if (m_bb.remaining() >= len2) { + m_bb.get(dst, off+cursor, len2); + cursor += len2; + break; + } else { + final int len3 = m_bb.remaining(); + m_bb.get(dst, off+cursor, len3); + cursor += len3; + } + } + + return cursor; + } + } } Copied: branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IAllocationContext.java (from rev 6889, branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/rawstore/IAllocationContext.java) =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IAllocationContext.java (rev 0) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IAllocationContext.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -0,0 +1,35 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package com.bigdata.rawstore; + +/** + * An {@link IAllocationContext} defines a shadow environment which may be + * associated with allocations made during a transaction. + * + * @author Martyn Cutcher + */ +public interface IAllocationContext { + +} Copied: branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IAllocationManagerStore.java (from rev 6889, branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/rawstore/IAllocationManagerStore.java) =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IAllocationManagerStore.java (rev 0) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IAllocationManagerStore.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -0,0 +1,81 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +package com.bigdata.rawstore; + +import java.nio.ByteBuffer; + +import com.bigdata.rwstore.IAllocationManager; + +/** + * Adds capability to write and delete allocations within an + * {@link IAllocationContext}. + * + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + * + * @see IAllocationManager + * @see IAllocationContext + */ +public interface IAllocationManagerStore extends IStreamStore { + + /** + * Write the data within the allocation context. The write is not visible + * outside of the allocation until the allocation context has been merged + * into the parent allocation context. + * + * @param data + * The data. + * @param context + * The allocation context. + * + * @return The address at which the data was written. + */ + long write(ByteBuffer data, IAllocationContext context); + + /** + * Delete the data associated with the address within the allocation + * context. The delete is not visible outside of the allocation until the + * allocation context has been merged into the parent allocation context. + * + * @param addr + * The address whose allocation is to be deleted. + * @param context + * The allocation context. + */ + void delete(long addr, IAllocationContext context); + + /** + * Return an output stream which can be used to write on the backing store + * within the given allocation context. You can recover the address used to + * read back the data from the {@link IPSOutputStream}. + * + * @param context + * The context within which any allocations are made by the + * returned {@link IPSOutputStream}. + * + * @return an output stream to stream data to and to retrieve an address to + * later stream the data back. + */ + public IPSOutputStream getOutputStream(final IAllocationContext context); + +} Copied: branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IPSOutputStream.java (from rev 6889, branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/rawstore/IPSOutputStream.java) =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IPSOutputStream.java (rev 0) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IPSOutputStream.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -0,0 +1,23 @@ +package com.bigdata.rawstore; + +import java.io.OutputStream; + +/** + * This class provides a stream-based allocation mechanism. + * <p> + * The intention is that an IPSOutputStream (PS for PerSistent) is + * returned by a storage service to which data can be written. + * When all data has been written the address from which to retriev + * an InputStream can be requested. + * + * @author Martyn Cutcher + * + */ +public abstract class IPSOutputStream extends OutputStream { + + /** + * Called when writes to the stream are complete. + * @return the address from which an InputStream can be retrieved. + */ + public abstract long getAddr(); +} Modified: branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IRawStore.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IRawStore.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IRawStore.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -86,7 +86,7 @@ * . * */ -public interface IRawStore extends IAddressManager, ICounterSetAccess { +public interface IRawStore extends IAddressManager, ICounterSetAccess, IStreamStore { /** * Write the data (unisolated). Copied: branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IStreamStore.java (from rev 6889, branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/rawstore/IStreamStore.java) =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IStreamStore.java (rev 0) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/IStreamStore.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -0,0 +1,56 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +package com.bigdata.rawstore; + +import java.io.InputStream; + + +/** + * Interface for reading and writing streams on a persistence store. + * + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + */ +public interface IStreamStore { + + /** + * Return an output stream which can be used to write on the backing store. + * You can recover the address used to read back the data from the + * {@link IPSOutputStream}. + * + * @return The output stream. + */ + public IPSOutputStream getOutputStream(); + + /** + * Return an input stream from which a previously written stream may be read + * back. + * + * @param addr + * The address at which the stream was written. + * + * @return an input stream for the data for provided address + */ + public InputStream getInputStream(long addr); + +} Copied: branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/RawStoreDelegate.java (from rev 6889, branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/rawstore/RawStoreDelegate.java) =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/RawStoreDelegate.java (rev 0) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/rawstore/RawStoreDelegate.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -0,0 +1,162 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2007. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +package com.bigdata.rawstore; + +import java.io.File; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.util.UUID; + +import com.bigdata.counters.CounterSet; +import com.bigdata.mdi.IResourceMetadata; + +/** + * Simple delegation pattern. + * + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + */ +public class RawStoreDelegate implements IRawStore { + + protected final IRawStore delegate; + + public RawStoreDelegate(final IRawStore delegate) { + this.delegate = delegate; + } + + @Override + public void close() { + delegate.close(); + } + + @Override + public void delete(long addr) { + delegate.delete(addr); + } + + @Override + public void deleteResources() { + delegate.deleteResources(); + } + + @Override + public void destroy() { + delegate.destroy(); + } + + @Override + public void force(boolean metadata) { + delegate.force(metadata); + } + + @Override + public int getByteCount(long addr) { + return delegate.getByteCount(addr); + } + + @Override + public CounterSet getCounters() { + return delegate.getCounters(); + } + + @Override + public File getFile() { + return delegate.getFile(); + } + + @Override + public long getOffset(long addr) { + return delegate.getOffset(addr); + } + + @Override + public long getPhysicalAddress(final long addr) { + return delegate.getPhysicalAddress(addr); + } + + @Override + public IResourceMetadata getResourceMetadata() { + return delegate.getResourceMetadata(); + } + + @Override + public UUID getUUID() { + return delegate.getUUID(); + } + + @Override + public boolean isFullyBuffered() { + return delegate.isFullyBuffered(); + } + + @Override + public boolean isOpen() { + return delegate.isOpen(); + } + + @Override + public boolean isReadOnly() { + return delegate.isReadOnly(); + } + + @Override + public boolean isStable() { + return delegate.isStable(); + } + + @Override + public ByteBuffer read(long addr) { + return delegate.read(addr); + } + + @Override + public long size() { + return delegate.size(); + } + + @Override + public long toAddr(int nbytes, long offset) { + return delegate.toAddr(nbytes, offset); + } + + @Override + public String toString(long addr) { + return delegate.toString(addr); + } + + @Override + public long write(ByteBuffer data) { + return delegate.write(data); + } + + @Override + public IPSOutputStream getOutputStream() { + return delegate.getOutputStream(); + } + + @Override + public InputStream getInputStream(long addr) { + return delegate.getInputStream(addr); + } + +} Modified: branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/Allocator.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/Allocator.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/Allocator.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -28,6 +28,7 @@ import java.util.ArrayList; import java.util.concurrent.atomic.AtomicLong; +import com.bigdata.rawstore.IAllocationContext; import com.bigdata.rwstore.RWStore.AllocationStats; Modified: branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/FixedAllocator.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/FixedAllocator.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/FixedAllocator.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -31,6 +31,7 @@ import org.apache.log4j.Logger; +import com.bigdata.rawstore.IAllocationContext; import com.bigdata.rwstore.RWStore.AllocationStats; import com.bigdata.rwstore.StorageStats.Bucket; import com.bigdata.util.ChecksumUtility; Deleted: branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/IAllocationContext.java =================================================================== --- branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/IAllocationContext.java 2013-02-06 00:51:42 UTC (rev 6889) +++ branches/READ_CACHE/bigdata/src/java/com/bigdata/rwstore/IAllocationContext.java 2013-02-06 01:07:30 UTC (rev 6890) @@ -1,35 +0,0 @@ -/** - -Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Pu... [truncated message content] |