]> source.dussan.org Git - jgit.git/commit
Store Git on any DHT 95/2295/24
authorShawn O. Pearce <spearce@spearce.org>
Wed, 2 Mar 2011 23:23:30 +0000 (15:23 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 5 May 2011 17:21:12 +0000 (10:21 -0700)
commitde8946c0c2c63907c0b14f2d9c419ac338b60588
tree09976f8a6dfd58605953db19d6434e7d613c0b7f
parent87455127a33fba9ebfdab9e2a611d4148c7501a4
Store Git on any DHT

jgit.storage.dht is a storage provider implementation for JGit that
permits storing the Git repository in a distributed hashtable, NoSQL
system, or other database.  The actual underlying storage system is
undefined, and can be plugged in by implementing 7 small interfaces:

  *  Database
  *  RepositoryIndexTable
  *  RepositoryTable
  *  RefTable
  *  ChunkTable
  *  ObjectIndexTable
  *  WriteBuffer

The storage provider interface tries to assume very little about the
underlying storage system, and requires only three key features:

  *  key -> value lookup (a hashtable is suitable)
  *  atomic updates on single rows
  *  asynchronous operations (Java's ExecutorService is easy to use)

Most NoSQL database products offer all 3 of these features in their
clients, and so does any decent network based cache system like the
open source memcache product.  Relying only on key equality for data
retrevial makes it simple for the storage engine to distribute across
multiple machines.  Traditional SQL systems could also be used with a
JDBC based spi implementation.

Before submitting this change I have implemented six storage systems
for the spi layer:

  * Apache HBase[1]
  * Apache Cassandra[2]
  * Google Bigtable[3]
  * an in-memory implementation for unit testing
  * a JDBC implementation for SQL
  * a generic cache provider that can ride on top of memcache

All six systems came in with an spi layer around 1000 lines of code to
implement the above 7 interfaces.  This is a huge reduction in size
compared to prior attempts to implement a new JGit storage layer.  As
this package shows, a complete JGit storage implementation is more
than 17,000 lines of fairly complex code.

A simple cache is provided in storage.dht.spi.cache.  Implementers can
use CacheDatabase to wrap any other type of Database and perform fast
reads against a network based cache service, such as the open source
memcached[4].  An implementation of CacheService must be provided to
glue this spi onto the network cache.

[1] https://github.com/spearce/jgit_hbase
[2] https://github.com/spearce/jgit_cassandra
[3] http://labs.google.com/papers/bigtable.html
[4] http://memcached.org/

Change-Id: I0aa4072781f5ccc019ca421c036adff2c40c4295
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
123 files changed:
org.eclipse.jgit.storage.dht.test/.classpath [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/.gitignore [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/.project [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/.settings/org.eclipse.core.resources.prefs [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/.settings/org.eclipse.jdt.ui.prefs [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/META-INF/MANIFEST.MF [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/build.properties [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/org.eclipse.jgit.storage.dht--All-Tests.launch [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/plugin.properties [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/pom.xml [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/tst/org/eclipse/jgit/storage/dht/ChunkIndexTest.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/tst/org/eclipse/jgit/storage/dht/ChunkKeyTest.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/tst/org/eclipse/jgit/storage/dht/DhtPackParserTest.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/tst/org/eclipse/jgit/storage/dht/DhtRepositoryBuilderTest.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/tst/org/eclipse/jgit/storage/dht/LargeNonDeltaObjectTest.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/tst/org/eclipse/jgit/storage/dht/ObjectIndexKeyTest.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/tst/org/eclipse/jgit/storage/dht/RepositoryKeyTest.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht.test/tst/org/eclipse/jgit/storage/dht/TimeoutTest.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/.classpath [new file with mode: 0644]
org.eclipse.jgit.storage.dht/.fbprefs [new file with mode: 0644]
org.eclipse.jgit.storage.dht/.gitignore [new file with mode: 0644]
org.eclipse.jgit.storage.dht/.project [new file with mode: 0644]
org.eclipse.jgit.storage.dht/.settings/org.eclipse.core.resources.prefs [new file with mode: 0644]
org.eclipse.jgit.storage.dht/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
org.eclipse.jgit.storage.dht/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
org.eclipse.jgit.storage.dht/.settings/org.eclipse.jdt.ui.prefs [new file with mode: 0644]
org.eclipse.jgit.storage.dht/META-INF/MANIFEST.MF [new file with mode: 0644]
org.eclipse.jgit.storage.dht/README [new file with mode: 0644]
org.eclipse.jgit.storage.dht/build.properties [new file with mode: 0644]
org.eclipse.jgit.storage.dht/plugin.properties [new file with mode: 0644]
org.eclipse.jgit.storage.dht/pom.xml [new file with mode: 0644]
org.eclipse.jgit.storage.dht/resources/org/eclipse/jgit/storage/dht/DhtText.properties [new file with mode: 0644]
org.eclipse.jgit.storage.dht/resources/org/eclipse/jgit/storage/dht/dht-schema.html [new file with mode: 0644]
org.eclipse.jgit.storage.dht/resources/org/eclipse/jgit/storage/dht/git_store.proto [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/AsyncCallback.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/BatchObjectLookup.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/CachedPackInfo.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/CachedPackKey.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/ChunkCache.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/ChunkCacheConfig.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/ChunkFormatter.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/ChunkIndex.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/ChunkInfo.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/ChunkKey.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/ChunkMeta.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DeltaBaseCache.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtCachedPack.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtConfig.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtException.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtInserter.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtInserterOptions.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtMissingChunkException.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtObjDatabase.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtObjectRepresentation.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtObjectToPack.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtPackParser.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtReader.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtReaderOptions.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtRefDatabase.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtRefRename.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtRefUpdate.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtRepository.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtRepositoryBuilder.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtText.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtTimeoutException.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/KeyUtils.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/LargeNonDeltaObject.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/ObjectIndexKey.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/ObjectInfo.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/ObjectWriter.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/OpenQueue.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/PackChunk.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/Prefetcher.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/QueueObjectLookup.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/RecentChunks.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/RecentInfoCache.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/RefData.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/RefKey.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/RepositoryKey.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/RepositoryName.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/RepresentationSelector.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/RowKey.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/SizeQueue.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/StreamingCallback.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/Sync.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/Timeout.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/TinyProtobuf.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/ChunkTable.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/Context.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/Database.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/ObjectIndexTable.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/RefTable.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/RepositoryIndexTable.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/RepositoryTable.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/WriteBuffer.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/cache/CacheBuffer.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/cache/CacheChunkTable.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/cache/CacheDatabase.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/cache/CacheKey.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/cache/CacheObjectIndexTable.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/cache/CacheOptions.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/cache/CacheRefTable.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/cache/CacheRepositoryIndexTable.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/cache/CacheRepositoryTable.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/cache/CacheService.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/cache/Namespace.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/memory/MemChunkTable.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/memory/MemObjectIndexTable.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/memory/MemRefTable.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/memory/MemRepositoryIndexTable.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/memory/MemRepositoryTable.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/memory/MemTable.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/memory/MemoryDatabase.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/util/AbstractWriteBuffer.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/util/ColumnMatcher.java [new file with mode: 0644]
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/spi/util/ExecutorTools.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectId.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectoryPackParser.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackOutputStream.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java
pom.xml