├── java ├── src15 │ ├── org │ │ └── nachodb │ │ │ ├── cd │ │ │ ├── impl │ │ │ ├── LoadFactory.java │ │ │ ├── sun14 │ │ │ │ └── Sun14ReflectionProvider.class │ │ │ ├── GenericSortArray.java │ │ │ ├── FastSerializable.java │ │ │ ├── SoftHashTable.java │ │ │ ├── OidHashTable.java │ │ │ ├── DefaultPersistentComparator.java │ │ │ ├── LRU.java │ │ │ ├── ObjectHeader.java │ │ │ ├── Page.java │ │ │ ├── ReflectionProvider.java │ │ │ ├── ReplicationMasterStorageImpl.java │ │ │ ├── StandardReflectionProvider.java │ │ │ ├── AltPersistentSet.java │ │ │ ├── ByteBuffer.java │ │ │ └── PersistentSet.java │ │ │ ├── IPersistentSet.java │ │ │ ├── IterableIterator.java │ │ │ ├── AssertionFailed.java │ │ │ ├── ReplicationMasterStorage.java │ │ │ ├── IValue.java │ │ │ ├── ReplicationSlaveStorage.java │ │ │ ├── XMLImportException.java │ │ │ ├── PersistentComparator.java │ │ │ ├── Blob.java │ │ │ ├── Relation.java │ │ │ ├── NullFile.java │ │ │ ├── MemoryUsage.java │ │ │ ├── IFile.java │ │ │ ├── PersistentString.java │ │ │ ├── Assert.java │ │ │ ├── StorageListener.java │ │ │ ├── L2ListElem.java │ │ │ ├── PatriciaTrie.java │ │ │ ├── StorageFactory.java │ │ │ ├── BitIndex.java │ │ │ └── PersistentCollection.java │ ├── tst │ │ ├── TestIndex.bat │ │ └── compile.bat │ ├── makedoc.bat │ └── compile.bat ├── tst │ ├── TestMod.bat │ ├── TestRaw.bat │ ├── TestSOD.bat │ ├── TestSSD.bat │ ├── TestXML.bat │ ├── guess.bat │ ├── TestLink.bat │ ├── TestRtree.bat │ ├── TestTtree.bat │ ├── compile.bat │ ├── OO7 │ │ ├── compile.bat │ │ ├── OO7.bat │ │ ├── README │ │ ├── OO7_ComplexAssembly.java │ │ ├── Benchmark.java │ │ ├── OO7_Assembly.java │ │ ├── OO7_BaseAssembly.java │ │ ├── OO7_Document.java │ │ ├── OO7_DesignObject.java │ │ ├── OO7_Manual.java │ │ ├── OO7_Connection.java │ │ ├── OO7_ComplexAssemblyImpl.java │ │ ├── OO7_AssemblyImpl.java │ │ ├── OO7_Module.java │ │ ├── OO7_CompositePart.java │ │ ├── OO7_AtomicPart.java │ │ ├── OO7_DocumentImpl.java │ │ ├── OO7_BaseAssemblyImpl.java │ │ ├── OO7_DesignObjectImpl.java │ │ ├── OO7_ManualImpl.java │ │ ├── OO7_ConnectionImpl.java │ │ ├── OO7_ModuleImpl.java │ │ ├── OO7_CompositePartImpl.java │ │ └── OO7_AtomicPartImpl.java │ ├── TestBackup.bat │ ├── TestBit.bat │ ├── TestBlob.bat │ ├── TestConcur.bat │ ├── TestGC.bat │ ├── TestIndex2.bat │ ├── TestR2.bat │ ├── TestSet.bat │ ├── aspectj │ │ ├── compile.bat │ │ ├── Guess.bat │ │ └── TestIndex.bat │ ├── TestIndex.bat │ ├── TestReplic.bat │ ├── TestTimeSeries.bat │ ├── TestMaxOid.bat │ ├── TestThickIndex.bat │ ├── TestCompoundIndex.bat │ ├── TestIndexIterator.bat │ ├── jassist │ │ ├── compile.bat │ │ ├── Guess.bat │ │ ├── TestIndex.bat │ │ └── Launcher.java │ ├── IpCountry.bat │ ├── runtests.bat │ └── TestRaw.java ├── lib │ ├── perst15.jar │ └── javassist.jar ├── src │ ├── lib │ │ ├── jdav.jar │ │ ├── vcm.jar │ │ └── jdavclient.jar │ ├── makedoc.bat │ ├── compile_aspectj.bat │ ├── org │ │ └── nachodb │ │ │ ├── jassist │ │ │ └── expr │ │ │ │ ├── License.html │ │ │ │ └── README │ │ │ ├── impl │ │ │ ├── LoadFactory.java │ │ │ ├── GenericSortArray.java │ │ │ ├── FastSerializable.java │ │ │ ├── SoftHashTable.java │ │ │ ├── OidHashTable.java │ │ │ ├── DefaultPersistentComparator.java │ │ │ ├── LRU.java │ │ │ ├── ObjectHeader.java │ │ │ ├── Page.java │ │ │ ├── ReflectionProvider.java │ │ │ ├── ReplicationMasterStorageImpl.java │ │ │ ├── StandardReflectionProvider.java │ │ │ ├── ByteBuffer.java │ │ │ └── RelationImpl.java │ │ │ ├── IPersistentSet.java │ │ │ ├── aspectj │ │ │ ├── SafeHashCode.aj │ │ │ ├── SafeHashAspect.aj │ │ │ ├── AutoPersist.aj │ │ │ └── StrictAutoPersist.aj │ │ │ ├── AssertionFailed.java │ │ │ ├── IValue.java │ │ │ ├── ReplicationMasterStorage.java │ │ │ ├── TimeSeriesTick.java │ │ │ ├── ReplicationSlaveStorage.java │ │ │ ├── XMLImportException.java │ │ │ ├── PersistentComparator.java │ │ │ ├── Blob.java │ │ │ ├── Relation.java │ │ │ ├── TimeSeriesBlock.java │ │ │ ├── NullFile.java │ │ │ ├── MemoryUsage.java │ │ │ ├── IFile.java │ │ │ ├── PersistentString.java │ │ │ ├── Assert.java │ │ │ ├── StorageListener.java │ │ │ ├── L2ListElem.java │ │ │ ├── StorageFactory.java │ │ │ └── BitIndex.java │ ├── compile.bat │ └── compile_jassist.bat ├── todo.txt ├── makezip.bat └── build.xml ├── scripts ├── build-release-and-upload.bat ├── build-release.bat ├── runtests.bat ├── runtestslong.bat ├── runcover.bat └── vc.bat ├── readme.txt ├── tools ├── CopyDocs.exe ├── opencover │ ├── Mono.Cecil.dll │ ├── Mono.Cecil.Pdb.dll │ ├── Gendarme.Framework.dll │ ├── OpenCover.Console.exe │ ├── OpenCover.Framework.dll │ ├── x64 │ │ └── OpenCover.Profiler.dll │ ├── x86 │ │ └── OpenCover.Profiler.dll │ ├── Microsoft.Practices.Unity.dll │ ├── Gendarme.Rules.Maintainability.dll │ ├── OpenCover.Console.exe.config │ └── License.txt └── ReportGenerator │ ├── log4net.dll │ ├── ReportGenerator.exe │ └── ICSharpCode.NRefactory.dll ├── perst-post-2.49-changes.txt ├── csharp ├── src │ ├── impl │ │ ├── PersistentWrapper.cs │ │ ├── GeneratedSerializer.cs │ │ ├── OidHashTable.cs │ │ ├── DefaultPersistentComparator.cs │ │ ├── LRU.cs │ │ ├── ObjectHeader.cs │ │ ├── Page.cs │ │ ├── ReplicationMasterStorageImpl.cs │ │ └── VolanteSink.cs │ ├── IBlob.cs │ ├── IReplicationMasterDatabase.cs │ ├── IClassLoader.cs │ ├── IReplicationSlaveDatabase.cs │ ├── L2ListElem.cs │ ├── PersistentComparator.cs │ ├── XMLImportException.cs │ ├── TransparentPersistenceAttribute.cs │ ├── ISet.cs │ ├── NullFile.cs │ ├── TypeMemoryUsage.cs │ ├── IPArray.cs │ ├── PersistentCollection.cs │ ├── DatabaseFactory.cs │ ├── IPatriciaTrie.cs │ ├── DatabaseListener.cs │ └── Relation.cs ├── tests │ └── Tests │ │ ├── app.config │ │ ├── TestIndex4.cs │ │ └── TestGC.cs ├── tools │ └── CopyDocs │ │ ├── app.config │ │ └── Properties │ │ └── AssemblyInfo.cs ├── examples │ ├── IpCountry │ │ └── IpCountry.bat │ └── DirectoryScan │ │ └── Properties │ │ └── AssemblyInfo.cs ├── doc │ ├── js │ │ ├── lang-proto.js │ │ ├── lang-wiki.js │ │ ├── lang-lua.js │ │ ├── lang-hs.js │ │ ├── lang-css.js │ │ ├── lang-lisp.js │ │ ├── prettify.css │ │ ├── lang-ml.js │ │ ├── lang-sql.js │ │ └── lang-vb.js │ ├── faq.html │ ├── main.css │ ├── misc.html │ ├── blobs.html │ ├── rc4encrypted.html │ ├── future.html │ ├── license.html │ ├── download.html │ ├── index_set.html │ └── devguideindex.html └── todo.txt ├── authors.txt ├── .gitignore └── license.txt /java/src15/org/nachodb/cd: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /java/tst/TestMod.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestMod 2 | -------------------------------------------------------------------------------- /java/tst/TestRaw.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestRaw 2 | -------------------------------------------------------------------------------- /java/tst/TestSOD.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestSOD 2 | -------------------------------------------------------------------------------- /java/tst/TestSSD.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestSSD 2 | -------------------------------------------------------------------------------- /java/tst/TestXML.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestXML 2 | -------------------------------------------------------------------------------- /java/tst/guess.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar Guess 2 | -------------------------------------------------------------------------------- /java/tst/TestLink.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestLink 2 | -------------------------------------------------------------------------------- /java/tst/TestRtree.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestRtree 2 | -------------------------------------------------------------------------------- /java/tst/TestTtree.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestTtree 2 | -------------------------------------------------------------------------------- /java/tst/compile.bat: -------------------------------------------------------------------------------- 1 | javac -g -classpath ..\lib\perst.jar;. *.java 2 | -------------------------------------------------------------------------------- /java/tst/OO7/compile.bat: -------------------------------------------------------------------------------- 1 | javac -g -classpath ..\..\lib\perst.jar;. *.java 2 | -------------------------------------------------------------------------------- /java/tst/TestBackup.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestBackup 2 | -------------------------------------------------------------------------------- /java/tst/TestBit.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestBit %1 %2 %3 2 | -------------------------------------------------------------------------------- /java/tst/TestBlob.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestBlob 2 | 3 | -------------------------------------------------------------------------------- /java/tst/TestConcur.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestConcur 2 | -------------------------------------------------------------------------------- /java/tst/TestGC.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestGC %1 %2 %3 2 | -------------------------------------------------------------------------------- /java/tst/TestIndex2.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestIndex2 2 | -------------------------------------------------------------------------------- /java/tst/TestR2.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestR2 %1 %2 %3 2 | -------------------------------------------------------------------------------- /java/tst/TestSet.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestSet %1 %2 %3 2 | -------------------------------------------------------------------------------- /java/tst/aspectj/compile.bat: -------------------------------------------------------------------------------- 1 | ajc *.aj -aspectpath ../../lib/perst_aspectj.jar -------------------------------------------------------------------------------- /java/tst/TestIndex.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestIndex %1 %2 %3 2 | -------------------------------------------------------------------------------- /java/tst/TestReplic.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestReplic %1 %2 %3 2 | -------------------------------------------------------------------------------- /java/tst/TestTimeSeries.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestTimeSeries 2 | -------------------------------------------------------------------------------- /scripts/build-release-and-upload.bat: -------------------------------------------------------------------------------- 1 | @call ./scripts/build-release.bat -upload 2 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | This repo is obsolete. See https://github.com/kjk/volante for new one. 2 | -------------------------------------------------------------------------------- /java/tst/OO7/OO7.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\..\lib\perst.jar BenchmarkImpl %1 %2 %3 %4 %5 2 | -------------------------------------------------------------------------------- /java/tst/TestMaxOid.bat: -------------------------------------------------------------------------------- 1 | java -Xmx512M -classpath .;..\lib\perst.jar TestMaxOid %1 %2 %3 2 | -------------------------------------------------------------------------------- /java/tst/TestThickIndex.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestThickIndex %1 %2 %3 2 | -------------------------------------------------------------------------------- /java/tst/aspectj/Guess.bat: -------------------------------------------------------------------------------- 1 | java -classpath ../../lib/perst_aspectj.jar;.;%classpath% Guess -------------------------------------------------------------------------------- /tools/CopyDocs.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/tools/CopyDocs.exe -------------------------------------------------------------------------------- /java/lib/perst15.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/java/lib/perst15.jar -------------------------------------------------------------------------------- /java/src/lib/jdav.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/java/src/lib/jdav.jar -------------------------------------------------------------------------------- /java/src/lib/vcm.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/java/src/lib/vcm.jar -------------------------------------------------------------------------------- /java/src/makedoc.bat: -------------------------------------------------------------------------------- 1 | javadoc -d ../doc -nodeprecated -nosince -public org/garret/perst/*.java 2 | -------------------------------------------------------------------------------- /java/tst/TestCompoundIndex.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestCompoundIndex %1 %2 %3 2 | -------------------------------------------------------------------------------- /java/tst/TestIndexIterator.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar TestIndexIterator %1 %2 %3 2 | -------------------------------------------------------------------------------- /java/tst/aspectj/TestIndex.bat: -------------------------------------------------------------------------------- 1 | java -classpath ../../lib/perst_aspectj.jar;.;%classpath% TestIndex -------------------------------------------------------------------------------- /java/tst/jassist/compile.bat: -------------------------------------------------------------------------------- 1 | javac -classpath ../../lib/perst.jar;../../lib/javassist.jar;. *.java -------------------------------------------------------------------------------- /java/lib/javassist.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/java/lib/javassist.jar -------------------------------------------------------------------------------- /java/tst/jassist/Guess.bat: -------------------------------------------------------------------------------- 1 | java -classpath ../../lib/perst.jar;../../lib/javassist.jar;. Launcher Guess -------------------------------------------------------------------------------- /java/src/lib/jdavclient.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/java/src/lib/jdavclient.jar -------------------------------------------------------------------------------- /java/tst/jassist/TestIndex.bat: -------------------------------------------------------------------------------- 1 | java -classpath ../../lib/perst.jar;../../lib/javassist.jar;. Launcher TestIndex -------------------------------------------------------------------------------- /perst-post-2.49-changes.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/perst-post-2.49-changes.txt -------------------------------------------------------------------------------- /tools/opencover/Mono.Cecil.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/tools/opencover/Mono.Cecil.dll -------------------------------------------------------------------------------- /java/src/compile_aspectj.bat: -------------------------------------------------------------------------------- 1 | ajc org/garret/perst/aspectj/*.aj -injars ../lib/perst.jar -outjar ../lib/perst_aspectj.jar -------------------------------------------------------------------------------- /tools/ReportGenerator/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/tools/ReportGenerator/log4net.dll -------------------------------------------------------------------------------- /tools/opencover/Mono.Cecil.Pdb.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/tools/opencover/Mono.Cecil.Pdb.dll -------------------------------------------------------------------------------- /tools/opencover/Gendarme.Framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/tools/opencover/Gendarme.Framework.dll -------------------------------------------------------------------------------- /tools/opencover/OpenCover.Console.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/tools/opencover/OpenCover.Console.exe -------------------------------------------------------------------------------- /tools/ReportGenerator/ReportGenerator.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/tools/ReportGenerator/ReportGenerator.exe -------------------------------------------------------------------------------- /tools/opencover/OpenCover.Framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/tools/opencover/OpenCover.Framework.dll -------------------------------------------------------------------------------- /tools/opencover/x64/OpenCover.Profiler.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/tools/opencover/x64/OpenCover.Profiler.dll -------------------------------------------------------------------------------- /tools/opencover/x86/OpenCover.Profiler.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/tools/opencover/x86/OpenCover.Profiler.dll -------------------------------------------------------------------------------- /csharp/src/impl/PersistentWrapper.cs: -------------------------------------------------------------------------------- 1 | namespace Volante.Impl 2 | { 3 | public interface PersistentWrapper 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /java/src/org/nachodb/jassist/expr/License.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/java/src/org/nachodb/jassist/expr/License.html -------------------------------------------------------------------------------- /tools/opencover/Microsoft.Practices.Unity.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/tools/opencover/Microsoft.Practices.Unity.dll -------------------------------------------------------------------------------- /tools/ReportGenerator/ICSharpCode.NRefactory.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/tools/ReportGenerator/ICSharpCode.NRefactory.dll -------------------------------------------------------------------------------- /tools/opencover/Gendarme.Rules.Maintainability.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/tools/opencover/Gendarme.Rules.Maintainability.dll -------------------------------------------------------------------------------- /java/src/org/nachodb/impl/LoadFactory.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | 3 | public interface LoadFactory { 4 | Object create(ClassDescriptor desc); 5 | } -------------------------------------------------------------------------------- /java/src15/org/nachodb/impl/LoadFactory.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | 3 | public interface LoadFactory { 4 | Object create(ClassDescriptor desc); 5 | } -------------------------------------------------------------------------------- /java/src15/tst/TestIndex.bat: -------------------------------------------------------------------------------- 1 | set SAVE_PATH=%PATH% 2 | set PATH=\j2sdk1.5.0\bin;%path% 3 | java -classpath .;..\..\lib\perst15.jar TestIndex 4 | set PATH=%SAVE_PATH% -------------------------------------------------------------------------------- /java/src15/tst/compile.bat: -------------------------------------------------------------------------------- 1 | set SAVE_PATH=%PATH% 2 | set PATH=\j2sdk1.5.0\bin;%path% 3 | javac -source 1.5 -g -classpath ..\..\lib\perst15.jar;. *.java 4 | set PATH=%SAVE_PATH% -------------------------------------------------------------------------------- /java/src15/org/nachodb/impl/sun14/Sun14ReflectionProvider.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjk/volante-obsolete/HEAD/java/src15/org/nachodb/impl/sun14/Sun14ReflectionProvider.class -------------------------------------------------------------------------------- /csharp/tests/Tests/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /authors.txt: -------------------------------------------------------------------------------- 1 | Current maintainer: 2 | Krzysztof Kowalczyk (http://blog.kowalczyk.info) 3 | 4 | Original author of Perst code base: 5 | Konstantin Knizhnik (http://www.garret.ru) 6 | 7 | -------------------------------------------------------------------------------- /java/src15/makedoc.bat: -------------------------------------------------------------------------------- 1 | set SAVE_PATH=%PATH% 2 | set PATH=\j2sdk1.5.0\bin;%path% 3 | javadoc -source 1.5 -d ../doc15 -nodeprecated -nosince -public org/garret/perst/*.java 4 | set PATH=%SAVE_PATH% -------------------------------------------------------------------------------- /csharp/tools/CopyDocs/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /java/src/org/nachodb/impl/GenericSortArray.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | 3 | public interface GenericSortArray { 4 | int size(); 5 | int compare(int i, int j); 6 | void swap(int i, int j); 7 | } -------------------------------------------------------------------------------- /java/src15/org/nachodb/impl/GenericSortArray.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | 3 | public interface GenericSortArray { 4 | int size(); 5 | int compare(int i, int j); 6 | void swap(int i, int j); 7 | } -------------------------------------------------------------------------------- /java/src/org/nachodb/IPersistentSet.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | import java.util.Set; 4 | 5 | /** 6 | * Interface of persistent set. 7 | */ 8 | public interface IPersistentSet extends IPersistent, IResource, Set {} 9 | -------------------------------------------------------------------------------- /tools/opencover/OpenCover.Console.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /java/src/compile.bat: -------------------------------------------------------------------------------- 1 | javac -g org\garret\perst\*.java org\garret\perst\impl\*.java org\garret\perst\impl\sun14\*.java 2 | jar cvf ..\lib\perst.jar org\garret\perst\*.class org\garret\perst\impl\*.class org\garret\perst\impl\sun14\*.class 3 | -------------------------------------------------------------------------------- /java/todo.txt: -------------------------------------------------------------------------------- 1 | Todo for Java: 2 | 3 | * test with other jvms (e.g. http://jamvm.sourceforge.net/) 4 | * change namespace to volante.org 5 | * Unix makefile and 6 | * maybe: write ant makefile (to make it easy to run from eclipse) 7 | -------------------------------------------------------------------------------- /java/src/org/nachodb/impl/FastSerializable.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | 3 | public interface FastSerializable { 4 | int pack(ByteBuffer buf, int offs, String encoding); 5 | int unpack(byte[] buf, int offs, String encoding); 6 | } -------------------------------------------------------------------------------- /java/src15/org/nachodb/impl/FastSerializable.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | 3 | public interface FastSerializable { 4 | int pack(ByteBuffer buf, int offs, String encoding); 5 | int unpack(byte[] buf, int offs, String encoding); 6 | } -------------------------------------------------------------------------------- /csharp/examples/IpCountry/IpCountry.bat: -------------------------------------------------------------------------------- 1 | bin\debug\IpCountry \iptocountry\resources\apnic.latest \iptocountry\resources\arin.latest \iptocountry\resources\lacnic.latest \iptocountry\resources\ripencc.latest < \iptocountry\iplist.txt > \temp\result.txt 2 | 3 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/IPersistentSet.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | import java.util.Set; 4 | 5 | /** 6 | * Interface of persistent set. 7 | */ 8 | public interface IPersistentSet extends IPersistent, IResource, Set {} 9 | -------------------------------------------------------------------------------- /java/tst/IpCountry.bat: -------------------------------------------------------------------------------- 1 | java -classpath .;..\lib\perst.jar IpCountry \iptocountry\resources\apnic.latest \iptocountry\resources\arin.latest \iptocountry\resources\lacnic.latest \iptocountry\resources\ripencc.latest < \iptocountry\iplist.txt > \temp\result.txt 2 | 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.suo 2 | *.dbs 3 | *bin/ 4 | *obj/ 5 | csharp/test.xml 6 | csharp/testalt.xml 7 | csharp/doc/perst.xml 8 | *.psess 9 | *.vsp 10 | partcover.driver.log 11 | *.user 12 | *.DS_Store 13 | scripts/awscreds.py 14 | csharp/cov 15 | *.userprefs 16 | -------------------------------------------------------------------------------- /scripts/build-release.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | SETLOCAL 3 | 4 | REM assumes we're being run from top-level directory as: 5 | REM scripts\build-release.bat 6 | 7 | CALL scripts\vc.bat 8 | IF ERRORLEVEL 1 EXIT /B 1 9 | 10 | python -u -B scripts\build-release.py %1 %2 %3 11 | -------------------------------------------------------------------------------- /java/src15/compile.bat: -------------------------------------------------------------------------------- 1 | set SAVE_PATH=%PATH% 2 | set PATH=\j2sdk1.5.0\bin;%path% 3 | javac -source 1.5 -g org\garret\perst\*.java org\garret\perst\impl\*.java org\garret\perst\impl\sun14\*.java 4 | jar cvf ..\lib\perst15.jar org\garret\perst\*.class org\garret\perst\impl\*.class org\garret\perst\impl\sun14\*.class 5 | set PATH=%SAVE_PATH% -------------------------------------------------------------------------------- /java/src/compile_jassist.bat: -------------------------------------------------------------------------------- 1 | javac -classpath .;..\lib\javassist.jar -g org\garret\perst\*.java org\garret\perst\impl\*.java org\garret\perst\impl\sun14\*.java org\garret\perst\jassist\*.java 2 | jar cvf ..\lib\perst.jar org\garret\perst\*.class org\garret\perst\impl\*.class org\garret\perst\impl\sun14\*.class org\garret\perst\jassist\*.class 3 | -------------------------------------------------------------------------------- /csharp/doc/js/lang-proto.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.sourceDecorator({keywords:"bool bytes default double enum extend extensions false fixed32 fixed64 float group import int32 int64 max message option optional package repeated required returns rpc service sfixed32 sfixed64 sint32 sint64 string syntax to true uint32 uint64",cStyleComments:true}),["proto"]); 2 | -------------------------------------------------------------------------------- /java/src/org/nachodb/impl/SoftHashTable.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | import java.lang.ref.*; 3 | 4 | public class SoftHashTable extends WeakHashTable { 5 | public SoftHashTable(int initialCapacity) { 6 | super(initialCapacity); 7 | } 8 | 9 | protected Reference createReference(Object obj) { 10 | return new SoftReference(obj); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/impl/SoftHashTable.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | import java.lang.ref.*; 3 | 4 | public class SoftHashTable extends WeakHashTable { 5 | public SoftHashTable(int initialCapacity) { 6 | super(initialCapacity); 7 | } 8 | 9 | protected Reference createReference(Object obj) { 10 | return new SoftReference(obj); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /csharp/src/impl/GeneratedSerializer.cs: -------------------------------------------------------------------------------- 1 | namespace Volante.Impl 2 | { 3 | using Volante; 4 | using System.Text; 5 | 6 | public interface GeneratedSerializer 7 | { 8 | IPersistent newInstance(); 9 | int pack(DatabaseImpl store, IPersistent obj, ByteBuffer buf); 10 | void unpack(DatabaseImpl store, IPersistent obj, byte[] body, bool recursiveLoading); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /csharp/src/impl/OidHashTable.cs: -------------------------------------------------------------------------------- 1 | namespace Volante.Impl 2 | { 3 | using Volante; 4 | 5 | public interface OidHashTable 6 | { 7 | bool Remove(int oid); 8 | void Put(int oid, IPersistent obj); 9 | IPersistent Get(int oid); 10 | void Flush(); 11 | void Invalidate(); 12 | void SetDirty(int oid); 13 | void ClearDirty(int oid); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /java/src/org/nachodb/aspectj/SafeHashCode.aj: -------------------------------------------------------------------------------- 1 | /* 2 | * Created on Jan 25, 2004 3 | * 4 | * To change the template for this generated file go to 5 | * Window>Preferences>Java>Code Generation>Code and Comments 6 | */ 7 | package org.nachodb.aspectj; 8 | 9 | /** 10 | * @author Patrick Morris-Suzuki 11 | * 12 | */ 13 | public interface SafeHashCode { 14 | public int safeHashCode(); 15 | } 16 | -------------------------------------------------------------------------------- /java/src/org/nachodb/AssertionFailed.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | /** 4 | * Exception raised by Assert class when assertion was failed. 5 | */ 6 | public class AssertionFailed extends Error { 7 | AssertionFailed() { 8 | super("Assertion failed"); 9 | } 10 | 11 | AssertionFailed(String description) { 12 | super("Assertion '" + description + "' failed"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/IterableIterator.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | import java.util.*; 4 | 5 | /** 6 | * Interface combining both Iterable and Iterator functionality 7 | */ 8 | public abstract class IterableIterator implements Iterable, Iterator { 9 | /** 10 | * This class itself is iterator 11 | */ 12 | public Iterator iterator() { 13 | return this; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/AssertionFailed.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | /** 4 | * Exception raised by Assert class when assertion was failed. 5 | */ 6 | public class AssertionFailed extends Error { 7 | AssertionFailed() { 8 | super("Assertion failed"); 9 | } 10 | 11 | AssertionFailed(String description) { 12 | super("Assertion '" + description + "' failed"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /csharp/src/IBlob.cs: -------------------------------------------------------------------------------- 1 | namespace Volante 2 | { 3 | /// 4 | /// Interface to store/fetch large binary objects 5 | /// 6 | public interface IBlob : IPersistent, IResource 7 | { 8 | /// 9 | /// Get stream to fetch/store BLOB data 10 | /// 11 | /// BLOB read/write stream 12 | System.IO.Stream GetStream(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /java/src/org/nachodb/IValue.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | /** 4 | * Interface of objects stored as value. Value objects are stored inside the persistent object to which they are belong 5 | * and not as separate instance. Value field can not conayins NULL value. When value object is changed, 6 | * programmer should call store method of persistent calss containing this value. 7 | */ 8 | public interface IValue { 9 | } 10 | -------------------------------------------------------------------------------- /java/src/org/nachodb/ReplicationMasterStorage.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | /** 4 | * Storage performing replication of changed pages to specified slave nodes. 5 | */ 6 | public interface ReplicationMasterStorage extends Storage { 7 | /** 8 | * Get number of currently available slave nodes 9 | * @return number of online replication slaves 10 | */ 11 | public int getNumberOfAvailableHosts(); 12 | } 13 | -------------------------------------------------------------------------------- /java/src/org/nachodb/TimeSeriesTick.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | /** 4 | * Interface for timeseries element. 5 | * You should derive your time series element from this class 6 | * and implement getTime method. 7 | */ 8 | public interface TimeSeriesTick extends IValue { 9 | /** 10 | * Get time series element timestamp 11 | * @return timestamp in milliseconds 12 | */ 13 | long getTime(); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/ReplicationMasterStorage.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | /** 4 | * Storage performing replication of changed pages to specified slave nodes. 5 | */ 6 | public interface ReplicationMasterStorage extends Storage { 7 | /** 8 | * Get number of currently available slave nodes 9 | * @return number of online replication slaves 10 | */ 11 | public int getNumberOfAvailableHosts(); 12 | } 13 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/IValue.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | /** 4 | * Interface of objects stored as value. Value objects are stored inside the persistent object to which they are belong 5 | * and not as separate instance. Value field can not conayins NULL value. When value object is changed, 6 | * programmer should call store method of persistent calss containing this value. 7 | */ 8 | public interface IValue { 9 | } 10 | -------------------------------------------------------------------------------- /java/src/org/nachodb/impl/OidHashTable.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | import org.nachodb.IPersistent; 3 | 4 | public interface OidHashTable { 5 | boolean remove(int oid); 6 | void put(int oid, IPersistent obj); 7 | IPersistent get(int oid); 8 | void flush(); 9 | void invalidate(); 10 | int size(); 11 | void setDirty(int oid); 12 | void clearDirty(int oid); 13 | } 14 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/impl/OidHashTable.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | import org.nachodb.IPersistent; 3 | 4 | public interface OidHashTable { 5 | boolean remove(int oid); 6 | void put(int oid, IPersistent obj); 7 | IPersistent get(int oid); 8 | void flush(); 9 | void invalidate(); 10 | int size(); 11 | void setDirty(int oid); 12 | void clearDirty(int oid); 13 | } 14 | -------------------------------------------------------------------------------- /csharp/doc/js/lang-wiki.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0a-gi-z0-9]+/,null,"\t\n\r \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[=*~\^\[\]]+/,null,"=*~^[]"]],[["kwd",/^#[a-z]+\b/,/(?:^|[\r\n])$/],["lit",/^(?:[A-Z][a-z][a-z0-9]+[A-Z][a-z][a-zA-Z0-9]+)\b/],["lang-",/^\{\{\{([\s\S]+?)\}\}\}/],["lang-",/^`([^\r\n`]+)`/],["str",/^https?:\/\/[^\/?#\s]*(?:\/[^?#\s]*)?(?:\?[^#\s]*)?(?:#\S*)?/i],["pln",/^[\s\S][^#=*~^A-Zh\{`\[]+/]]),["wiki"]); 2 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/impl/DefaultPersistentComparator.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | 3 | import org.nachodb.*; 4 | 5 | public class DefaultPersistentComparator extends PersistentComparator { 6 | public int compareMembers(T m1, T m2) { 7 | return m1.compareTo(m2); 8 | } 9 | 10 | public int compareMemberWithKey(T mbr, Object key) { 11 | return mbr.compareTo(key); 12 | } 13 | } -------------------------------------------------------------------------------- /java/src/org/nachodb/impl/DefaultPersistentComparator.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | 3 | import org.nachodb.*; 4 | 5 | public class DefaultPersistentComparator extends PersistentComparator { 6 | public int compareMembers(IPersistent m1, IPersistent m2) { 7 | return ((Comparable)m1).compareTo(m2); 8 | } 9 | 10 | public int compareMemberWithKey(IPersistent mbr, Object key) { 11 | return ((Comparable)mbr).compareTo(key); 12 | } 13 | } -------------------------------------------------------------------------------- /java/src/org/nachodb/jassist/expr/README: -------------------------------------------------------------------------------- 1 | This directory contains JAssist source files changed by me to make it possible 2 | to distinguish access to fields of this and foreign objects. 3 | As far as JAssist is distributed under LGPL license, these files are also 4 | can be used and distributed under the conditions described in this license. 5 | All other Perst code is distributed under its own MIT-like license. 6 | Home page of Jassist is http://www.csg.is.titech.ac.jp/~chiba/javassist/. 7 | -------------------------------------------------------------------------------- /csharp/src/IReplicationMasterDatabase.cs: -------------------------------------------------------------------------------- 1 | namespace Volante 2 | { 3 | /// 4 | /// Database performing replication of changed pages to specified slave nodes. 5 | /// 6 | public interface ReplicationMasterDatabase : IDatabase 7 | { 8 | /// 9 | /// Get number of currently available slave nodes 10 | /// 11 | /// number of online replication slaves 12 | int GetNumberOfAvailableHosts(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /java/src/org/nachodb/impl/LRU.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | 3 | class LRU { 4 | LRU next; 5 | LRU prev; 6 | 7 | LRU() 8 | { 9 | next = prev = this; 10 | } 11 | 12 | final void unlink() 13 | { 14 | next.prev = prev; 15 | prev.next = next; 16 | } 17 | 18 | final void link(LRU node) 19 | { 20 | node.next = next; 21 | node.prev = this; 22 | next.prev = node; 23 | next = node; 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/impl/LRU.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | 3 | class LRU { 4 | LRU next; 5 | LRU prev; 6 | 7 | LRU() 8 | { 9 | next = prev = this; 10 | } 11 | 12 | final void unlink() 13 | { 14 | next.prev = prev; 15 | prev.next = next; 16 | } 17 | 18 | final void link(LRU node) 19 | { 20 | node.next = next; 21 | node.prev = this; 22 | next.prev = node; 23 | next = node; 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /csharp/doc/js/lang-lua.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\s\S]*?(?:\]\1\]|$)|[^\r\n]*)/],["str",/^\[(=*)\[[\s\S]*?(?:\]\1\]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^[a-z_]\w*/i], 2 | ["pun",/^[^\w\t\n\r \xA0]+/]]),["lua"]); 3 | -------------------------------------------------------------------------------- /csharp/src/impl/DefaultPersistentComparator.cs: -------------------------------------------------------------------------------- 1 | namespace Volante.Impl 2 | { 3 | using System; 4 | using Volante; 5 | 6 | public class DefaultPersistentComparator : PersistentComparator where V : class,IPersistent, IComparable, IComparable 7 | { 8 | public override int CompareMembers(V m1, V m2) 9 | { 10 | return m1.CompareTo(m2); 11 | } 12 | 13 | public override int CompareMemberWithKey(V mbr, K key) 14 | { 15 | return mbr.CompareTo(key); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /csharp/src/IClassLoader.cs: -------------------------------------------------------------------------------- 1 | namespace Volante 2 | { 3 | using System; 4 | 5 | /// 6 | /// Interface to provide application apecific class loading 7 | /// 8 | public interface IClassLoader 9 | { 10 | /// 11 | /// Load class with specified name. 12 | /// 13 | /// full name of the class to be loaded 14 | /// loaded class or null if class can not be loaded 15 | Type LoadClass(string name); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /java/tst/jassist/Launcher.java: -------------------------------------------------------------------------------- 1 | import javassist.*; 2 | import org.garret.perst.jassist.PerstTranslator; 3 | 4 | public class Launcher { 5 | public static void main(String[] args) throws Throwable { 6 | if (args.length != 1) { 7 | System.err.println("Usage: java Laucher CLASS-NAME"); 8 | } else { 9 | Translator trans = new PerstTranslator(); 10 | ClassPool pool = ClassPool.getDefault(trans); 11 | Loader cl = new Loader(pool); 12 | Thread.currentThread().setContextClassLoader(cl); 13 | cl.run(args[0], args); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /java/src/org/nachodb/impl/ObjectHeader.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | 3 | class ObjectHeader { 4 | static final int sizeof = 8; 5 | 6 | static int getSize(byte[] arr, int offs) { 7 | return Bytes.unpack4(arr, offs); 8 | } 9 | static void setSize(byte[] arr, int offs, int size) { 10 | Bytes.pack4(arr, offs, size); 11 | } 12 | static int getType(byte[] arr, int offs) { 13 | return Bytes.unpack4(arr, offs+4); 14 | } 15 | static void setType(byte[] arr, int offs, int type) { 16 | Bytes.pack4(arr, offs+4, type); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/impl/ObjectHeader.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | 3 | class ObjectHeader { 4 | static final int sizeof = 8; 5 | 6 | static int getSize(byte[] arr, int offs) { 7 | return Bytes.unpack4(arr, offs); 8 | } 9 | static void setSize(byte[] arr, int offs, int size) { 10 | Bytes.pack4(arr, offs, size); 11 | } 12 | static int getType(byte[] arr, int offs) { 13 | return Bytes.unpack4(arr, offs+4); 14 | } 15 | static void setType(byte[] arr, int offs, int type) { 16 | Bytes.pack4(arr, offs+4, type); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /java/src/org/nachodb/aspectj/SafeHashAspect.aj: -------------------------------------------------------------------------------- 1 | /* 2 | * Created on Jan 25, 2004 3 | * 4 | * To change the template for this generated file go to 5 | * Window>Preferences>Java>Code Generation>Code and Comments 6 | */ 7 | package org.nachodb.aspectj; 8 | 9 | /** 10 | * @author Patrick Morris-Suzuki 11 | * 12 | */ 13 | 14 | public aspect SafeHashAspect { 15 | 16 | declare precedence: PersistenceAspect+, SafeHashAspect; 17 | 18 | int around(SafeHashCode me): 19 | execution(int SafeHashCode+.hashCode()) && target(me){ 20 | return me.safeHashCode(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /csharp/src/impl/LRU.cs: -------------------------------------------------------------------------------- 1 | namespace Volante.Impl 2 | { 3 | using System; 4 | using Volante; 5 | 6 | class LRU 7 | { 8 | internal LRU next; 9 | internal LRU prev; 10 | 11 | internal LRU() 12 | { 13 | next = prev = this; 14 | } 15 | 16 | internal void unlink() 17 | { 18 | next.prev = prev; 19 | prev.next = next; 20 | } 21 | 22 | internal void link(LRU node) 23 | { 24 | node.next = next; 25 | node.prev = this; 26 | next.prev = node; 27 | next = node; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /scripts/runtests.bat: -------------------------------------------------------------------------------- 1 | call "%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat" 2 | @IF ERRORLEVEL 1 GOTO TRYX86 3 | @GOTO BUILD 4 | 5 | :TRYX86 6 | call "%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat" 7 | @IF ERRORLEVEL 1 GOTO NEEDSVS 8 | 9 | :BUILD 10 | cd csharp 11 | devenv Volante.sln /Rebuild Debug /Project Tests 12 | @IF ERRORLEVEL 1 GOTO FAILEDCOMPILE 13 | 14 | @cd bin\Debug 15 | Tests.exe -fast 16 | 17 | @goto END 18 | 19 | :FAILEDCOMPILE 20 | @echo "Compilcation failed" 21 | @goto END 22 | 23 | :NEEDSVS 24 | @echo Visual Studio 2010 doesn't seem to be installed 25 | @goto END 26 | 27 | :END 28 | -------------------------------------------------------------------------------- /scripts/runtestslong.bat: -------------------------------------------------------------------------------- 1 | call "%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat" 2 | IF ERRORLEVEL 1 GOTO TRYX86 3 | GOTO BUILD 4 | 5 | :TRYX86 6 | call "%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat" 7 | IF ERRORLEVEL 1 GOTO NEEDSVS 8 | 9 | :BUILD 10 | cd csharp 11 | devenv Volante.sln /Project tests\Tests\Tests.csproj /ProjectConfig Release /Rebuild 12 | IF ERRORLEVEL 1 GOTO FAILEDCOMPILE 13 | 14 | bin\Release\Tests.exe -slow 15 | 16 | goto END 17 | 18 | :FAILEDCOMPILE 19 | echo "Compilcation failed" 20 | goto END 21 | 22 | :NEEDSVS 23 | echo Visual Studio 2010 doesn't seem to be installed 24 | 25 | :END 26 | -------------------------------------------------------------------------------- /csharp/doc/js/lang-hs.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])\'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:(?:--+(?:[^\r\n\x0C_:\"\'\(\),;\[\]`\{\}][^\r\n\x0C_]*)?(?=[\x0C\r\n]|$))|(?:\{-(?:[^-]|-+[^-\}])*-\}))/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^a-zA-Z0-9\']|$)/, 2 | null],["pln",/^(?:[A-Z][\w\']*\.)*[a-zA-Z][\w\']*/],["pun",/^[^\t\n\x0B\x0C\r a-zA-Z0-9\'\"]+/]]),["hs"]); 3 | -------------------------------------------------------------------------------- /java/makezip.bat: -------------------------------------------------------------------------------- 1 | del src\org\garret\perst\*.class 2 | del src\org\garret\perst\impl\*.class 3 | del src\org\garret\perst\impl\sun14\*.class 4 | del src\org\garret\perst\aspectj\*.class 5 | del src\org\garret\perst\jassist\*.class 6 | del src15\org\garret\perst\*.class 7 | del src15\org\garret\perst\impl\*.class 8 | del src15\tst\*.class 9 | del src15\tst\*.dbs 10 | del tst\OO7\*.class 11 | del tst\OO7\*.dbs 12 | del tst\*.class 13 | del tst\*.dbs 14 | del tst\*.xml 15 | del tst\aspectj\*.dbs 16 | del tst\aspectj\*.class 17 | del tst\jassist\*.dbs 18 | del tst\jassist\*.class 19 | del lib\perst_aspectj.jar 20 | rd /s/q classes 21 | cd .. 22 | del perst.zip 23 | zip -r perst.zip perst -------------------------------------------------------------------------------- /java/tst/OO7/README: -------------------------------------------------------------------------------- 1 | What does the example do? 2 | ------------------------- 3 | 4 | This example implements the OO7 benchmark. OO7 is a simple yet OODBMS 5 | benchmark. Implementation was taken from Ozone database (with minor bug fixes and changes). 6 | 7 | 8 | How to build it? 9 | ---------------- 10 | Use compile.bat 11 | 12 | How to run it? 13 | -------------- 14 | Run OO7.bat 15 | 16 | Reference results (Amd Athlon 1.333Gh WinXP) 17 | ------------------------------------------ 18 | command Perst Ozone 19 | 20 | create small 1 041 112 732 21 | query traversal 1 352 13 680 22 | query match 0 431 0 591 23 | -------------------------------------------------------------------------------- /java/tst/OO7/OO7_ComplexAssembly.java: -------------------------------------------------------------------------------- 1 | // You can redistribute this software and/or modify it under the terms of 2 | // the Ozone Core License version 1 published by ozone-db.org. 3 | // 4 | // The original code and portions created by Thorsten Fiebig are 5 | // Copyright (C) 2000-@year@ by Thorsten Fiebig. All rights reserved. 6 | // Code portions created by SMB are 7 | // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved. 8 | // 9 | // $Id$ 10 | 11 | import org.garret.perst.Link; 12 | 13 | 14 | public interface OO7_ComplexAssembly extends OO7_Assembly { 15 | 16 | 17 | public void addSubAssembly( OO7_Assembly x ); 18 | 19 | 20 | public Link subAssemblies(); 21 | } 22 | -------------------------------------------------------------------------------- /csharp/doc/js/lang-css.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[ \t\r\n\f]+/,null," \t\r\n\u000c"]],[["str",/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],["str",/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["str",/^\([^\)\"\']*\)/,/\burl/i],["kwd",/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["kwd",/^-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*(?=\s*:)/i],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],["com",/^(?: 8 | 9 | 10 | 11 | 12 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /java/src/org/nachodb/PersistentString.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | /** 4 | * Class encapsulating native Java string. java.lang.String is not persistent object 5 | * so it can not be stored in Perst as independent persistent object. 6 | * But sometimes it is needed. This class sole this problem providing implcit conversion 7 | * operator from java.lang.String to PerisstentString. 8 | * Also PersistentString class is mutable, allowing to change it's values. 9 | */ 10 | public class PersistentString extends PersistentResource 11 | { 12 | /** 13 | * Consutrctor of perisstent string 14 | * @param str Java string 15 | */ 16 | public PersistentString(String str) 17 | { 18 | this.str = str; 19 | } 20 | 21 | /** 22 | * Get Java string 23 | * @return Java string 24 | */ 25 | public String toString() 26 | { 27 | return str; 28 | } 29 | 30 | /** 31 | * Append string to the current string value of PersistentString 32 | * @param tail appended string 33 | */ 34 | public void append(String tail) 35 | { 36 | modify(); 37 | str = str + tail; 38 | } 39 | 40 | /** 41 | * Assign new string value to the PersistentString 42 | * @param str new string value 43 | */ 44 | public void set(String str) 45 | { 46 | modify(); 47 | this.str = str; 48 | } 49 | 50 | /** 51 | * Get current string value 52 | * @return Java string 53 | */ 54 | public String get() 55 | { 56 | return str; 57 | } 58 | 59 | private String str; 60 | } 61 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/PersistentString.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | /** 4 | * Class encapsulating native Java string. java.lang.String is not persistent object 5 | * so it can not be stored in Perst as independent persistent object. 6 | * But sometimes it is needed. This class sole this problem providing implcit conversion 7 | * operator from java.lang.String to PerisstentString. 8 | * Also PersistentString class is mutable, allowing to change it's values. 9 | */ 10 | public class PersistentString extends PersistentResource 11 | { 12 | /** 13 | * Consutrctor of perisstent string 14 | * @param str Java string 15 | */ 16 | public PersistentString(String str) 17 | { 18 | this.str = str; 19 | } 20 | 21 | /** 22 | * Get Java string 23 | * @return Java string 24 | */ 25 | public String toString() 26 | { 27 | return str; 28 | } 29 | 30 | /** 31 | * Append string to the current string value of PersistentString 32 | * @param tail appended string 33 | */ 34 | public void append(String tail) 35 | { 36 | modify(); 37 | str = str + tail; 38 | } 39 | 40 | /** 41 | * Assign new string value to the PersistentString 42 | * @param str new string value 43 | */ 44 | public void set(String str) 45 | { 46 | modify(); 47 | this.str = str; 48 | } 49 | 50 | /** 51 | * Get current string value 52 | * @return Java string 53 | */ 54 | public String get() 55 | { 56 | return str; 57 | } 58 | 59 | private String str; 60 | } 61 | -------------------------------------------------------------------------------- /java/src/org/nachodb/Assert.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | /** Class for checking program invariants. Analog of C assert() 4 | * macro. The Java compiler doesn't provide information about compiled 5 | * file and line number, so the place of assertion failure can be located only 6 | * by analyzing the stack trace of the thrown AssertionFailed exception. 7 | * 8 | * @see org.nachodb.AssertionFailed 9 | */ 10 | public class Assert { 11 | /** Check specified condition and raise AssertionFailed 12 | * exception if it is not true. 13 | * 14 | * @param cond result of checked condition 15 | */ 16 | public static final void that(boolean cond) { 17 | if (!cond) { 18 | throw new AssertionFailed(); 19 | } 20 | } 21 | 22 | /** Check specified condition and raise AssertionFailed 23 | * exception if it is not true. 24 | * 25 | * @param description string describing checked condition 26 | * @param cond result of checked condition 27 | */ 28 | public static final void that(String description, boolean cond) { 29 | if (!cond) { 30 | throw new AssertionFailed(description); 31 | } 32 | } 33 | 34 | /** 35 | * Throw assertion failed exception. 36 | */ 37 | public static final void failed() { 38 | throw new AssertionFailed(); 39 | } 40 | 41 | /** 42 | * Throw assertion failed exception with given description. 43 | */ 44 | public static final void failed(String description) { 45 | throw new AssertionFailed(description); 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/Assert.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | /** Class for checking program invariants. Analog of C assert() 4 | * macro. The Java compiler doesn't provide information about compiled 5 | * file and line number, so the place of assertion failure can be located only 6 | * by analyzing the stack trace of the thrown AssertionFailed exception. 7 | * 8 | * @see org.nachodb.AssertionFailed 9 | */ 10 | public class Assert { 11 | /** Check specified condition and raise AssertionFailed 12 | * exception if it is not true. 13 | * 14 | * @param cond result of checked condition 15 | */ 16 | public static final void that(boolean cond) { 17 | if (!cond) { 18 | throw new AssertionFailed(); 19 | } 20 | } 21 | 22 | /** Check specified condition and raise AssertionFailed 23 | * exception if it is not true. 24 | * 25 | * @param description string describing checked condition 26 | * @param cond result of checked condition 27 | */ 28 | public static final void that(String description, boolean cond) { 29 | if (!cond) { 30 | throw new AssertionFailed(description); 31 | } 32 | } 33 | 34 | /** 35 | * Throw assertion failed exception. 36 | */ 37 | public static final void failed() { 38 | throw new AssertionFailed(); 39 | } 40 | 41 | /** 42 | * Throw assertion failed exception with given description. 43 | */ 44 | public static final void failed(String description) { 45 | throw new AssertionFailed(description); 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /csharp/src/NullFile.cs: -------------------------------------------------------------------------------- 1 | namespace Volante 2 | { 3 | /// 4 | /// This implementation of IFile interface can be used 5 | /// to make Volante as an main-memory database. It should be used when 6 | /// cacheSizeInBytes is set to 0. 7 | /// In this case all pages are cached in memory and NullFile 8 | /// is used just as a stub. 9 | /// NullFile should be used only when data is transient 10 | /// i.e. it will not be saved between database sessions. If you need 11 | /// an in-memory database that provides data persistency, 12 | /// you should use normal file and infinite page pool size. 13 | /// 14 | public class NullFile : IFile 15 | { 16 | public FileListener Listener { get; set; } 17 | 18 | public void Write(long pos, byte[] buf) 19 | { 20 | if (Listener != null) 21 | Listener.OnWrite(pos, buf.Length); 22 | } 23 | 24 | public int Read(long pos, byte[] buf) 25 | { 26 | if (Listener != null) 27 | Listener.OnRead(pos, buf.Length, 0); 28 | return 0; 29 | } 30 | 31 | public void Sync() 32 | { 33 | if (Listener != null) 34 | Listener.OnSync(); 35 | } 36 | 37 | public void Lock() { } 38 | 39 | public void Close() { } 40 | 41 | public bool NoFlush 42 | { 43 | get { return false; } 44 | set { } 45 | } 46 | 47 | public long Length 48 | { 49 | get { return 0; } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /csharp/src/TypeMemoryUsage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Volante 4 | { 5 | /// 6 | /// Information about memory usage for one type. 7 | /// Instances of this class are created by IDatabase.GetMemoryUsage method. 8 | /// Size of internal database structures (object index,* memory allocation bitmap) is associated with 9 | /// Database class. Size of class descriptors - with System.Type class. 10 | /// 11 | public class TypeMemoryUsage 12 | { 13 | /// 14 | /// Class of persistent object or Database for database internal data 15 | /// 16 | public Type Type; 17 | 18 | /// 19 | /// Number of reachable instance of the particular class in the database. 20 | /// 21 | public int Count; 22 | 23 | /// 24 | /// Total size of all reachable instances 25 | /// 26 | public long TotalSize; 27 | 28 | /// 29 | /// Real allocated size of all instances. Database allocates space for th objects using quantums, 30 | /// for example object wilth size 25 bytes will use 32 bytes in the db. 31 | /// In item associated with Database class this field contains size of all allocated 32 | /// space in the database (marked as used in bitmap) 33 | /// 34 | public long AllocatedSize; 35 | 36 | /// 37 | /// TypeMemoryUsage constructor 38 | /// 39 | public TypeMemoryUsage(Type type) 40 | { 41 | this.Type = type; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /java/tst/OO7/OO7_ConnectionImpl.java: -------------------------------------------------------------------------------- 1 | // You can redistribute this software and/or modify it under the terms of 2 | // the Ozone Core License version 1 published by ozone-db.org. 3 | // 4 | // The original code and portions created by Thorsten Fiebig are 5 | // Copyright (C) 2000-@year@ by Thorsten Fiebig. All rights reserved. 6 | // Code portions created by SMB are 7 | // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved. 8 | // 9 | // $Id$ 10 | 11 | import org.garret.perst.Persistent; 12 | 13 | 14 | public class OO7_ConnectionImpl extends Persistent implements OO7_Connection { 15 | String theType; 16 | long theLength; 17 | OO7_AtomicPart theFrom; 18 | OO7_AtomicPart theTo; 19 | 20 | 21 | private OO7_ConnectionImpl() {} 22 | 23 | public OO7_ConnectionImpl(String type) { 24 | theType = type; 25 | } 26 | 27 | 28 | public void setType( String x ) { 29 | theType = x; 30 | modify(); 31 | } 32 | 33 | 34 | public String type() { 35 | return theType; 36 | } 37 | 38 | 39 | public void setLength( long x ) { 40 | theLength = x; 41 | modify(); 42 | } 43 | 44 | 45 | public long length() { 46 | return theLength; 47 | } 48 | 49 | 50 | public void setFrom( OO7_AtomicPart x ) { 51 | theFrom = x; 52 | modify(); 53 | } 54 | 55 | 56 | public OO7_AtomicPart from() { 57 | return theFrom; 58 | } 59 | 60 | 61 | public void setTo( OO7_AtomicPart x ) { 62 | theTo = x; 63 | modify(); 64 | } 65 | 66 | 67 | public OO7_AtomicPart to() { 68 | return theTo; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /csharp/doc/js/lang-vb.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})(?:[\"\u201C\u201D][cC]|$)|[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})*(?:[\"\u201C\u201D]|$))/,null,'"\u201c\u201d'],["com",/^[\'\u2018\u2019][^\r\n\u2028\u2029]*/,null,"'\u2018\u2019"]],[["kwd",/^(?:AddHandler|AddressOf|Alias|And|AndAlso|Ansi|As|Assembly|Auto|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDbl|CDec|Char|CInt|Class|CLng|CObj|Const|CShort|CSng|CStr|CType|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get|GetType|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|New|Next|Not|NotInheritable|NotOverridable|Object|On|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Preserve|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TypeOf|Unicode|Until|Variant|Wend|When|While|With|WithEvents|WriteOnly|Xor|EndIf|GoSub|Let|Variant|Wend)\b/i, 2 | null],["com",/^REM[^\r\n\u2028\u2029]*/i],["lit",/^(?:True\b|False\b|Nothing\b|\d+(?:E[+\-]?\d+[FRD]?|[FRDSIL])?|(?:&H[0-9A-F]+|&O[0-7]+)[SIL]?|\d*\.\d+(?:E[+\-]?\d+)?[FRD]?|#\s+(?:\d+[\-\/]\d+[\-\/]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)?|\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*|\[(?:[a-z]|_\w)\w*\])/i],["pun",/^[^\w\t\n\r \"\'\[\]\xA0\u2018\u2019\u201C\u201D\u2028\u2029]+/],["pun",/^(?:\[|\])/]]),["vb","vbs"]); 3 | -------------------------------------------------------------------------------- /csharp/src/IPArray.cs: -------------------------------------------------------------------------------- 1 | namespace Volante 2 | { 3 | using System; 4 | 5 | /// 6 | /// Common interface for all PArrays 7 | /// 8 | public interface IGenericPArray 9 | { 10 | /// Get number of the array elements 11 | /// 12 | /// the number of related objects 13 | /// 14 | /// 15 | int Size(); 16 | 17 | /// Get oid of array element. 18 | /// 19 | /// index of the object in the relation 20 | /// 21 | /// oid of the object (0 if array contains null reference) 22 | /// 23 | int GetOid(int i); 24 | 25 | /// 26 | /// Set owner object for this PArray. Owner is persistent object contaning this PArray. 27 | /// This method is mostly used by db itself, but can also used explicitly by programmer if 28 | /// Parray component of one persistent object is assigned to component of another persistent object 29 | /// 30 | /// owner of the array 31 | void SetOwner(IPersistent owner); 32 | } 33 | 34 | /// Dynamically extended array of references to persistent objects. 35 | /// It is inteded to be used in classes using virtual properties to 36 | /// access components of persistent objects. You can not use standard 37 | /// C# array here, instead you should use PArray class. 38 | /// PArray is created by IDatabase.CreateArray method 39 | /// 40 | public interface IPArray : IGenericPArray, ILink where T : class,IPersistent 41 | { 42 | } 43 | } -------------------------------------------------------------------------------- /csharp/doc/rc4encrypted.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Encrypted database 9 | 10 | 11 | 12 |
13 |
14 |
15 |
16 |
17 | 18 |
19 |

Volante : Volante Developer's Guide : Encrypted database

20 | 21 |

You can use a simple RC4 encryption for your database files by using Rc4File implememntation of IFile interface:

22 | 23 |
string password="mypassword";
24 | Rc4File file = new Rc4File(filePath, password);
25 | try
26 | {
27 |     Open(file);
28 | }
29 | catch (DatabaseException)
30 | {
31 |     file.Close();
32 |     throw;
33 | }
34 | 
35 | 36 |

You can also implement your own encryption schemes. You can use Rc4File.cs as a reference.

37 | 38 |
← schema evolution  •  performance tuning →
39 | 40 |
41 |
Volante is maintained by Krzysztof Kowalczyk
42 | 43 |
44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /java/src/org/nachodb/impl/StandardReflectionProvider.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | import java.lang.reflect.*; 3 | import java.util.*; 4 | 5 | public class StandardReflectionProvider implements ReflectionProvider { 6 | static final Class[] defaultConstructorProfile = new Class[0]; 7 | 8 | public Constructor getDefaultConstructor(Class cls) throws Exception { 9 | return cls.getDeclaredConstructor(defaultConstructorProfile); 10 | } 11 | 12 | public void setInt(Field field, Object object, int value) throws Exception { 13 | field.setInt(object, value); 14 | } 15 | 16 | public void setLong(Field field, Object object, long value) throws Exception { 17 | field.setLong(object, value); 18 | } 19 | 20 | public void setShort(Field field, Object object, short value) throws Exception { 21 | field.setShort(object, value); 22 | } 23 | 24 | public void setChar(Field field, Object object, char value) throws Exception { 25 | field.setChar(object, value); 26 | } 27 | 28 | public void setByte(Field field, Object object, byte value) throws Exception { 29 | field.setByte(object, value); 30 | } 31 | 32 | public void setFloat(Field field, Object object, float value) throws Exception { 33 | field.setFloat(object, value); 34 | } 35 | 36 | public void setDouble(Field field, Object object, double value) throws Exception { 37 | field.setDouble(object, value); 38 | } 39 | 40 | public void setBoolean(Field field, Object object, boolean value) throws Exception { 41 | field.setBoolean(object, value); 42 | } 43 | 44 | public void set(Field field, Object object, Object value) throws Exception { 45 | field.set(object, value); 46 | } 47 | } -------------------------------------------------------------------------------- /java/src15/org/nachodb/impl/StandardReflectionProvider.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | import java.lang.reflect.*; 3 | import java.util.*; 4 | 5 | public class StandardReflectionProvider implements ReflectionProvider { 6 | static final Class[] defaultConstructorProfile = new Class[0]; 7 | 8 | public Constructor getDefaultConstructor(Class cls) throws Exception { 9 | return cls.getDeclaredConstructor(defaultConstructorProfile); 10 | } 11 | 12 | public void setInt(Field field, Object object, int value) throws Exception { 13 | field.setInt(object, value); 14 | } 15 | 16 | public void setLong(Field field, Object object, long value) throws Exception { 17 | field.setLong(object, value); 18 | } 19 | 20 | public void setShort(Field field, Object object, short value) throws Exception { 21 | field.setShort(object, value); 22 | } 23 | 24 | public void setChar(Field field, Object object, char value) throws Exception { 25 | field.setChar(object, value); 26 | } 27 | 28 | public void setByte(Field field, Object object, byte value) throws Exception { 29 | field.setByte(object, value); 30 | } 31 | 32 | public void setFloat(Field field, Object object, float value) throws Exception { 33 | field.setFloat(object, value); 34 | } 35 | 36 | public void setDouble(Field field, Object object, double value) throws Exception { 37 | field.setDouble(object, value); 38 | } 39 | 40 | public void setBoolean(Field field, Object object, boolean value) throws Exception { 41 | field.setBoolean(object, value); 42 | } 43 | 44 | public void set(Field field, Object object, Object value) throws Exception { 45 | field.set(object, value); 46 | } 47 | } -------------------------------------------------------------------------------- /csharp/doc/future.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Future of Volante 7 | 8 | 9 |
10 |
11 |
12 |
13 |
14 | 15 |
16 |

Volante : Volante Developer's Guide : Future of Volante

17 | 18 |

Volante is feature-rich, fast and stable.

19 | 20 |

My focus with Volante is reliability and documention. Most of my effort is spent writing documentation, automated test framework, adding more tests and fixing bugs exposed by those tests.

21 | 22 |

Adding new features has lower priority. New features will be added based on feedback from people using Volante in real software. You can use the bug tracker to request new features. When requesting new features please also describe why the feature is valuable, not just describe what it should do.

23 | 24 |

Volante is an open-source project. The source is at github.com/kjk/volante and I welcome particiapation in the project. If you want to contribute the code, the usual rules apply: fork the repo, make the changes, send a pull request.

25 | 26 |
← history  •  license →
27 | 28 |
29 |
Volante is maintained by Krzysztof Kowalczyk
30 | 31 |
32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /csharp/doc/license.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | License 7 | 8 | 9 | 10 |
11 |
12 |
13 |
14 |
15 | 16 |
17 |

Volante : Volante Developer's Guide : License

18 | 19 |

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

20 | 21 |

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OF THIS SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

22 | 23 |
← future  •  numbers every programmer should know →
24 | 25 |
26 |
Volante is maintained by Krzysztof Kowalczyk
27 | 28 |
29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /java/tst/OO7/OO7_ModuleImpl.java: -------------------------------------------------------------------------------- 1 | // You can redistribute this software and/or modify it under the terms of 2 | // the Ozone Core License version 1 published by ozone-db.org. 3 | // 4 | // The original code and portions created by Thorsten Fiebig are 5 | // Copyright (C) 2000-@year@ by Thorsten Fiebig. All rights reserved. 6 | // Code portions created by SMB are 7 | // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved. 8 | // 9 | // $Id$ 10 | 11 | import org.garret.perst.*; 12 | 13 | public class OO7_ModuleImpl extends OO7_DesignObjectImpl implements OO7_Module { 14 | OO7_Manual theManual; 15 | Link theAssembly; 16 | Index theComponents; 17 | OO7_ComplexAssembly theDesignRoot; 18 | 19 | 20 | private OO7_ModuleImpl() {} 21 | 22 | public OO7_ModuleImpl(Storage storage) { 23 | theAssembly = storage.createLink(); 24 | theComponents = storage.createIndex(String.class, true); 25 | } 26 | 27 | 28 | public void setManual( OO7_Manual x ) { 29 | theManual = x; 30 | modify(); 31 | } 32 | 33 | 34 | public OO7_Manual manual() { 35 | return theManual; 36 | } 37 | 38 | 39 | public void addAssembly( OO7_Assembly x ) { 40 | theAssembly.add( x ); 41 | modify(); 42 | } 43 | 44 | 45 | public Link assembly() { 46 | return theAssembly; 47 | } 48 | 49 | 50 | public void setDesignRoot( OO7_ComplexAssembly x ) { 51 | theDesignRoot = x; 52 | modify(); 53 | } 54 | 55 | 56 | public OO7_ComplexAssembly designRoot() { 57 | return theDesignRoot; 58 | } 59 | 60 | public OO7_AtomicPart getAtomicPartByName(String name) 61 | { 62 | return (OO7_AtomicPart)theComponents.get(name); 63 | } 64 | 65 | 66 | public void addAtomicPart(String name, OO7_AtomicPart part) 67 | { 68 | theComponents.put(name, part); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /java/tst/TestRaw.java: -------------------------------------------------------------------------------- 1 | import org.garret.perst.*; 2 | 3 | import java.util.HashMap; 4 | 5 | class L1List implements java.io.Serializable { 6 | L1List next; 7 | Object obj; 8 | Object root; 9 | 10 | L1List(Object value, Object tree, L1List list) { 11 | obj = value; 12 | root = tree; 13 | next = list; 14 | } 15 | }; 16 | 17 | public class TestRaw extends Persistent { 18 | L1List list; 19 | HashMap map; 20 | Object nil; 21 | 22 | static final int nListMembers = 100; 23 | static final int nHashMembers = 1000; 24 | 25 | public static void main(String[] args) { 26 | Storage db = StorageFactory.getInstance().createStorage(); 27 | db.setProperty("perst.serialize.transient.objects", Boolean.TRUE); 28 | db.open("testraw.dbs"); 29 | TestRaw root = (TestRaw)db.getRoot(); 30 | if (root == null) { 31 | root = new TestRaw(); 32 | db.setRoot(root); 33 | L1List list = null; 34 | for (int i = 0; i < nListMembers; i++) { 35 | list = new L1List(new Integer(i), root, list); 36 | } 37 | root.list = list; 38 | root.map = new HashMap(); 39 | for (int i = 0; i < nHashMembers; i++) { 40 | root.map.put("key-" + i, "value-" + i); 41 | } 42 | root.store(); 43 | System.out.println("Initialization of database completed"); 44 | } 45 | L1List list = root.list; 46 | for (int i = nListMembers; --i >= 0;) { 47 | Assert.that(list.obj.equals(new Integer(i))); 48 | Assert.that(root == list.root); 49 | list = list.next; 50 | } 51 | for (int i = nHashMembers; --i >= 0;) { 52 | Assert.that(root.map.get("key-" + i).equals("value-" + i)); 53 | } 54 | System.out.println("Database is OK"); 55 | db.close(); 56 | } 57 | } 58 | 59 | -------------------------------------------------------------------------------- /java/src/org/nachodb/StorageListener.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | /** 4 | * Listener of database events. Programmer should derive his own subclass and register 5 | * it using Storage.setListener method. 6 | */ 7 | public abstract class StorageListener { 8 | /** 9 | * This metod is called during database open when database was not 10 | * close normally and has to be recovered 11 | */ 12 | public void databaseCorrupted() {} 13 | 14 | /** 15 | * This method is called after completion of recovery 16 | */ 17 | public void recoveryCompleted() {} 18 | 19 | /** 20 | * This method is called when garbage collection is started (ether explicitly 21 | * by invocation of Storage.gc() method, either implicitly after allocation 22 | * of some amount of memory)). 23 | */ 24 | public void gcStarted() {} 25 | 26 | /** 27 | * This method is called when unreferenced object is deallocated from 28 | * database. It is possible to get instance of the object using 29 | * Storage.getObjectByOid() method. 30 | * @param cls class of deallocated object 31 | * @param oid object identifier of deallocated object 32 | */ 33 | public void deallocateObject(Class cls, int oid) {} 34 | 35 | /** 36 | * This method is called when garbage collection is completed 37 | * @param nDeallocatedObjects number of deallocated objects 38 | */ 39 | public void gcCompleted(int nDeallocatedObjects) {} 40 | 41 | /** 42 | * Handle replication error 43 | * @param host address of host replication to which is failed (null if error jappens at slave node) 44 | * @return true if host should be reconnected and attempt to send data to it should be 45 | * repeated, false if no more attmpts to communicate with this host should be performed 46 | */ 47 | public boolean replicationError(String host) { 48 | return false; 49 | } 50 | } 51 | 52 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/StorageListener.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | /** 4 | * Listener of database events. Programmer should derive his own subclass and register 5 | * it using Storage.setListener method. 6 | */ 7 | public abstract class StorageListener { 8 | /** 9 | * This metod is called during database open when database was not 10 | * close normally and has to be recovered 11 | */ 12 | public void databaseCorrupted() {} 13 | 14 | /** 15 | * This method is called after completion of recovery 16 | */ 17 | public void recoveryCompleted() {} 18 | 19 | /** 20 | * This method is called when garbage collection is started (ether explicitly 21 | * by invocation of Storage.gc() method, either implicitly after allocation 22 | * of some amount of memory)). 23 | */ 24 | public void gcStarted() {} 25 | 26 | /** 27 | * This method is called when unreferenced object is deallocated from 28 | * database. It is possible to get instance of the object using 29 | * Storage.getObjectByOid() method. 30 | * @param cls class of deallocated object 31 | * @param oid object identifier of deallocated object 32 | */ 33 | public void deallocateObject(Class cls, int oid) {} 34 | 35 | /** 36 | * This method is called when garbage collection is completed 37 | * @param nDeallocatedObjects number of deallocated objects 38 | */ 39 | public void gcCompleted(int nDeallocatedObjects) {} 40 | 41 | /** 42 | * Handle replication error 43 | * @param host address of host replication to which is failed (null if error jappens at slave node) 44 | * @return true if host should be reconnected and attempt to send data to it should be 45 | * repeated, false if no more attmpts to communicate with this host should be performed 46 | */ 47 | public boolean replicationError(String host) { 48 | return false; 49 | } 50 | } 51 | 52 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/impl/AltPersistentSet.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | import org.nachodb.*; 3 | import java.util.*; 4 | 5 | class AltPersistentSet extends AltBtree implements IPersistentSet { 6 | AltPersistentSet() { 7 | type = ClassDescriptor.tpObject; 8 | unique = true; 9 | } 10 | 11 | public boolean isEmpty() { 12 | return nElems == 0; 13 | } 14 | 15 | public boolean contains(Object o) { 16 | if (o instanceof IPersistent) { 17 | Key key = new Key((IPersistent)o); 18 | Iterator i = iterator(key, key, ASCENT_ORDER); 19 | return i.hasNext(); 20 | } 21 | return false; 22 | } 23 | 24 | public Object[] toArray() { 25 | return toPersistentArray(); 26 | } 27 | 28 | public E[] toArray(E[] arr) { 29 | return (E[])super.toArray((T[])arr); 30 | } 31 | 32 | public boolean add(T obj) { 33 | return put(new Key(obj), obj); 34 | } 35 | 36 | public boolean remove(Object o) { 37 | T obj = (T)o; 38 | try { 39 | remove(new Key(obj), obj); 40 | } catch (StorageError x) { 41 | if (x.getErrorCode() == StorageError.KEY_NOT_FOUND) { 42 | return false; 43 | } 44 | throw x; 45 | } 46 | return true; 47 | } 48 | 49 | public boolean equals(Object o) { 50 | if (o == this) { 51 | return true; 52 | } 53 | if (!(o instanceof Set)) { 54 | return false; 55 | } 56 | Collection c = (Collection) o; 57 | if (c.size() != size()) { 58 | return false; 59 | } 60 | return containsAll(c); 61 | } 62 | 63 | public int hashCode() { 64 | int h = 0; 65 | Iterator i = iterator(); 66 | while (i.hasNext()) { 67 | h += ((IPersistent)i.next()).getOid(); 68 | } 69 | return h; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /java/src/org/nachodb/L2ListElem.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | /** 4 | * Double linked list element. 5 | */ 6 | 7 | public class L2ListElem extends PersistentResource { 8 | protected L2ListElem next; 9 | protected L2ListElem prev; 10 | 11 | /** 12 | * Get next list element. 13 | * Been call for the last list element, this method will return first element of the list 14 | * or list header 15 | */ 16 | public L2ListElem getNext() { 17 | return next; 18 | } 19 | 20 | /** 21 | * Get previous list element. 22 | * Been call for the first list element, this method will return last element of the list 23 | * or list header 24 | */ 25 | public L2ListElem getPrev() { 26 | return prev; 27 | } 28 | 29 | /** 30 | * Make list empty. 31 | * This method should be applied to list header. 32 | */ 33 | public void prune() { 34 | modify(); 35 | next = prev = null; 36 | } 37 | 38 | /** 39 | * Link specified element in the list after this element 40 | * @param elem element to be linked in the list after this elemen 41 | */ 42 | public void linkAfter(L2ListElem elem) { 43 | modify(); 44 | next.modify(); 45 | elem.modify(); 46 | elem.next = next; 47 | elem.prev = this; 48 | next.prev = elem; 49 | next = elem; 50 | } 51 | 52 | /** 53 | * Link specified element in the list before this element 54 | * @param elem element to be linked in the list before this elemen 55 | */ 56 | public void linkBefore(L2ListElem elem) { 57 | modify(); 58 | prev.modify(); 59 | elem.modify(); 60 | elem.next = this; 61 | elem.prev = prev; 62 | prev.next = elem; 63 | prev = elem; 64 | } 65 | 66 | /** 67 | * Remove element from the list 68 | */ 69 | public void unlink() { 70 | next.modify(); 71 | prev.modify(); 72 | next.prev = prev; 73 | prev.next = next; 74 | } 75 | } -------------------------------------------------------------------------------- /java/src15/org/nachodb/L2ListElem.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | /** 4 | * Double linked list element. 5 | */ 6 | 7 | public class L2ListElem extends PersistentResource { 8 | protected L2ListElem next; 9 | protected L2ListElem prev; 10 | 11 | /** 12 | * Get next list element. 13 | * Been call for the last list element, this method will return first element of the list 14 | * or list header 15 | */ 16 | public L2ListElem getNext() { 17 | return next; 18 | } 19 | 20 | /** 21 | * Get previous list element. 22 | * Been call for the first list element, this method will return last element of the list 23 | * or list header 24 | */ 25 | public L2ListElem getPrev() { 26 | return prev; 27 | } 28 | 29 | /** 30 | * Make list empty. 31 | * This method should be applied to list header. 32 | */ 33 | public void prune() { 34 | modify(); 35 | next = prev = null; 36 | } 37 | 38 | /** 39 | * Link specified element in the list after this element 40 | * @param elem element to be linked in the list after this elemen 41 | */ 42 | public void linkAfter(L2ListElem elem) { 43 | modify(); 44 | next.modify(); 45 | elem.modify(); 46 | elem.next = next; 47 | elem.prev = this; 48 | next.prev = elem; 49 | next = elem; 50 | } 51 | 52 | /** 53 | * Link specified element in the list before this element 54 | * @param elem element to be linked in the list before this elemen 55 | */ 56 | public void linkBefore(L2ListElem elem) { 57 | modify(); 58 | prev.modify(); 59 | elem.modify(); 60 | elem.next = this; 61 | elem.prev = prev; 62 | prev.next = elem; 63 | prev = elem; 64 | } 65 | 66 | /** 67 | * Remove element from the list 68 | */ 69 | public void unlink() { 70 | next.modify(); 71 | prev.modify(); 72 | next.prev = prev; 73 | prev.next = next; 74 | } 75 | } -------------------------------------------------------------------------------- /java/src/org/nachodb/impl/ByteBuffer.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | 3 | import java.io.UnsupportedEncodingException; 4 | import org.nachodb.StorageError; 5 | 6 | public class ByteBuffer { 7 | public final void extend(int size) { 8 | if (size > arr.length) { 9 | int newLen = size > arr.length*2 ? size : arr.length*2; 10 | byte[] newArr = new byte[newLen]; 11 | System.arraycopy(arr, 0, newArr, 0, used); 12 | arr = newArr; 13 | } 14 | used = size; 15 | } 16 | 17 | final byte[] toArray() { 18 | byte[] result = new byte[used]; 19 | System.arraycopy(arr, 0, result, 0, used); 20 | return result; 21 | } 22 | 23 | 24 | int packString(int dst, String value, String encoding) { 25 | if (value == null) { 26 | extend(dst + 4); 27 | Bytes.pack4(arr, dst, -1); 28 | dst += 4; 29 | } else { 30 | int length = value.length(); 31 | if (encoding == null) { 32 | extend(dst + 4 + 2*length); 33 | Bytes.pack4(arr, dst, length); 34 | dst += 4; 35 | for (int i = 0; i < length; i++) { 36 | Bytes.pack2(arr, dst, (short)value.charAt(i)); 37 | dst += 2; 38 | } 39 | } else { 40 | try { 41 | byte[] bytes = value.getBytes(encoding); 42 | extend(dst + 4 + bytes.length); 43 | Bytes.pack4(arr, dst, -2-bytes.length); 44 | System.arraycopy(bytes, 0, arr, dst+4, bytes.length); 45 | dst += 4 + bytes.length; 46 | } catch (UnsupportedEncodingException x) { 47 | throw new StorageError(StorageError.UNSUPPORTED_ENCODING); 48 | } 49 | } 50 | } 51 | return dst; 52 | } 53 | 54 | ByteBuffer() { 55 | arr = new byte[64]; 56 | } 57 | 58 | public byte[] arr; 59 | public int used; 60 | } 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/impl/ByteBuffer.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | 3 | import java.io.UnsupportedEncodingException; 4 | import org.nachodb.StorageError; 5 | 6 | public class ByteBuffer { 7 | public final void extend(int size) { 8 | if (size > arr.length) { 9 | int newLen = size > arr.length*2 ? size : arr.length*2; 10 | byte[] newArr = new byte[newLen]; 11 | System.arraycopy(arr, 0, newArr, 0, used); 12 | arr = newArr; 13 | } 14 | used = size; 15 | } 16 | 17 | final byte[] toArray() { 18 | byte[] result = new byte[used]; 19 | System.arraycopy(arr, 0, result, 0, used); 20 | return result; 21 | } 22 | 23 | 24 | int packString(int dst, String value, String encoding) { 25 | if (value == null) { 26 | extend(dst + 4); 27 | Bytes.pack4(arr, dst, -1); 28 | dst += 4; 29 | } else { 30 | int length = value.length(); 31 | if (encoding == null) { 32 | extend(dst + 4 + 2*length); 33 | Bytes.pack4(arr, dst, length); 34 | dst += 4; 35 | for (int i = 0; i < length; i++) { 36 | Bytes.pack2(arr, dst, (short)value.charAt(i)); 37 | dst += 2; 38 | } 39 | } else { 40 | try { 41 | byte[] bytes = value.getBytes(encoding); 42 | extend(dst + 4 + bytes.length); 43 | Bytes.pack4(arr, dst, -2-bytes.length); 44 | System.arraycopy(bytes, 0, arr, dst+4, bytes.length); 45 | dst += 4 + bytes.length; 46 | } catch (UnsupportedEncodingException x) { 47 | throw new StorageError(StorageError.UNSUPPORTED_ENCODING); 48 | } 49 | } 50 | } 51 | return dst; 52 | } 53 | 54 | ByteBuffer() { 55 | arr = new byte[64]; 56 | } 57 | 58 | public byte[] arr; 59 | public int used; 60 | } 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/impl/PersistentSet.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | import org.nachodb.*; 3 | import java.util.*; 4 | 5 | class PersistentSet extends Btree implements IPersistentSet { 6 | PersistentSet() { 7 | type = ClassDescriptor.tpObject; 8 | unique = true; 9 | } 10 | 11 | public boolean isEmpty() { 12 | return nElems == 0; 13 | } 14 | 15 | public boolean contains(Object o) { 16 | if (o instanceof IPersistent) { 17 | Key key = new Key((IPersistent)o); 18 | Iterator i = iterator(key, key, ASCENT_ORDER); 19 | return i.hasNext(); 20 | } 21 | return false; 22 | } 23 | 24 | public Object[] toArray() { 25 | return toPersistentArray(); 26 | } 27 | 28 | public E[] toArray(E[] arr) { 29 | return (E[])super.toArray((T[])arr); 30 | } 31 | 32 | public boolean add(T obj) { 33 | if (!obj.isPersistent()) { 34 | ((StorageImpl)getStorage()).makePersistent(obj); 35 | } 36 | return put(new Key(obj), obj); 37 | } 38 | 39 | public boolean remove(Object o) { 40 | T obj = (T)o; 41 | try { 42 | remove(new Key(obj), obj); 43 | } catch (StorageError x) { 44 | if (x.getErrorCode() == StorageError.KEY_NOT_FOUND) { 45 | return false; 46 | } 47 | throw x; 48 | } 49 | return true; 50 | } 51 | 52 | public boolean equals(Object o) { 53 | if (o == this) { 54 | return true; 55 | } 56 | if (!(o instanceof Set)) { 57 | return false; 58 | } 59 | Collection c = (Collection) o; 60 | if (c.size() != size()) { 61 | return false; 62 | } 63 | return containsAll(c); 64 | } 65 | 66 | public int hashCode() { 67 | int h = 0; 68 | Iterator i = iterator(); 69 | while (i.hasNext()) { 70 | h += ((IPersistent)i.next()).getOid(); 71 | } 72 | return h; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /csharp/doc/download.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Volante - download 7 | 8 | 9 | 10 | 34 | 35 | 36 | 37 | 38 |
39 |
40 |
41 |
42 |
43 | 44 |
45 |

Volante : Download

46 | 47 |

Download Volante for .NET

48 | 49 |

(built on , Volante.dll size: )

50 | 51 |

This file contains Volante.dll that you can add to your .NET projects and a documentation in HTML format (also available on-line).

52 | 53 |

You can also download the source code and include it in your program (add Volante.csproj to your solution)

54 | 55 |
56 |
Volante is maintained by Krzysztof Kowalczyk
57 | 58 |
59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /java/tst/OO7/OO7_CompositePartImpl.java: -------------------------------------------------------------------------------- 1 | // You can redistribute this software and/or modify it under the terms of 2 | // the Ozone Core License version 1 published by ozone-db.org. 3 | // 4 | // The original code and portions created by Thorsten Fiebig are 5 | // Copyright (C) 2000-@year@ by Thorsten Fiebig. All rights reserved. 6 | // Code portions created by SMB are 7 | // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved. 8 | // 9 | // $Id$ 10 | 11 | import org.garret.perst.*; 12 | 13 | 14 | public class OO7_CompositePartImpl extends OO7_DesignObjectImpl implements OO7_CompositePart { 15 | OO7_Document theDocumentation; 16 | Link theUsedInPriv; 17 | Link theUsedInShar; 18 | Link theParts; 19 | OO7_AtomicPart theRootPart; 20 | 21 | 22 | private OO7_CompositePartImpl() {} 23 | 24 | public OO7_CompositePartImpl(Storage storage) { 25 | theUsedInPriv = storage.createLink(); 26 | theUsedInShar = storage.createLink(); 27 | theParts = storage.createLink(); 28 | } 29 | 30 | 31 | public void setDocumentation( OO7_Document x ) { 32 | theDocumentation = x; 33 | modify(); 34 | } 35 | 36 | 37 | public OO7_Document documentation() { 38 | return theDocumentation; 39 | } 40 | 41 | 42 | public void addUsedInPriv( OO7_BaseAssembly x ) { 43 | theUsedInPriv.add( x ); 44 | modify(); 45 | } 46 | 47 | 48 | public Link usedInPriv() { 49 | return theUsedInPriv; 50 | } 51 | 52 | 53 | public void addUsedInShar( OO7_BaseAssembly x ) { 54 | theUsedInShar.add( x ); 55 | modify(); 56 | } 57 | 58 | 59 | public Link usedInShar() { 60 | return theUsedInShar; 61 | } 62 | 63 | 64 | public void addPart( OO7_AtomicPart x ) { 65 | theParts.add( x ); 66 | modify(); 67 | } 68 | 69 | 70 | public Link parts() { 71 | return theParts; 72 | } 73 | 74 | 75 | public void setRootPart( OO7_AtomicPart x ) { 76 | theRootPart = x; 77 | modify(); 78 | } 79 | 80 | 81 | public OO7_AtomicPart rootPart() { 82 | return theRootPart; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /csharp/src/PersistentCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | namespace Volante 6 | { 7 | /// 8 | /// Base class for all persistent collections 9 | /// 10 | public abstract class PersistentCollection : PersistentResource, ICollection where T : class,IPersistent 11 | { 12 | public PersistentCollection() 13 | { 14 | } 15 | 16 | public PersistentCollection(IDatabase db) 17 | : base(db) 18 | { 19 | } 20 | 21 | public abstract IEnumerator GetEnumerator(); 22 | 23 | IEnumerator IEnumerable.GetEnumerator() 24 | { 25 | return GetEnumerator(); 26 | } 27 | 28 | public abstract int Count 29 | { 30 | get; 31 | } 32 | 33 | public virtual bool IsSynchronized 34 | { 35 | get 36 | { 37 | return true; 38 | } 39 | } 40 | 41 | public virtual object SyncRoot 42 | { 43 | get 44 | { 45 | return this; 46 | } 47 | } 48 | 49 | public virtual void CopyTo(T[] dst, int i) 50 | { 51 | foreach (object o in this) 52 | { 53 | dst.SetValue(o, i++); 54 | } 55 | } 56 | 57 | public virtual void Add(T obj) 58 | { 59 | throw new InvalidOperationException("Add is not supported"); 60 | } 61 | 62 | public abstract void Clear(); 63 | 64 | public virtual bool IsReadOnly 65 | { 66 | get 67 | { 68 | return false; 69 | } 70 | } 71 | 72 | public virtual bool Contains(T obj) 73 | { 74 | foreach (T o in this) 75 | { 76 | if (o == obj) 77 | return true; 78 | } 79 | return false; 80 | } 81 | 82 | public virtual bool Remove(T obj) 83 | { 84 | throw new InvalidOperationException("Remove is not supported"); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /java/tst/OO7/OO7_AtomicPartImpl.java: -------------------------------------------------------------------------------- 1 | // You can redistribute this software and/or modify it under the terms of 2 | // the Ozone Core License version 1 published by ozone-db.org. 3 | // 4 | // The original code and portions created by Thorsten Fiebig are 5 | // Copyright (C) 2000-@year@ by Thorsten Fiebig. All rights reserved. 6 | // Code portions created by SMB are 7 | // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved. 8 | // 9 | // $Id$ 10 | 11 | import org.garret.perst.*; 12 | 13 | 14 | public class OO7_AtomicPartImpl extends OO7_DesignObjectImpl implements OO7_AtomicPart { 15 | long theX; 16 | long theY; 17 | long theDocId; 18 | Link theToConnections; 19 | Link theFromConnections; 20 | OO7_CompositePart thePartOf; 21 | 22 | 23 | private OO7_AtomicPartImpl() {} 24 | 25 | public OO7_AtomicPartImpl(Storage storage) { 26 | theToConnections = storage.createLink(); 27 | theFromConnections = storage.createLink(); 28 | } 29 | 30 | 31 | public void setX( long x ) { 32 | theX = x; 33 | modify(); 34 | } 35 | 36 | 37 | public long x() { 38 | return theX; 39 | } 40 | 41 | 42 | public void setY( long x ) { 43 | theY = x; 44 | modify(); 45 | } 46 | 47 | 48 | public long y() { 49 | return theY; 50 | } 51 | 52 | 53 | public void setDocId( long x ) { 54 | theDocId = x; 55 | modify(); 56 | } 57 | 58 | 59 | public long docId() { 60 | return theDocId; 61 | } 62 | 63 | 64 | public void addTo( OO7_Connection x ) { 65 | theToConnections.add( x ); 66 | modify(); 67 | } 68 | 69 | 70 | public Link to() { 71 | return theToConnections; 72 | } 73 | 74 | 75 | public void addFrom( OO7_Connection x ) { 76 | theFromConnections.add( x ); 77 | modify(); 78 | } 79 | 80 | 81 | public Link from() { 82 | return theFromConnections; 83 | } 84 | 85 | 86 | public void setPartOf( OO7_CompositePart x ) { 87 | thePartOf = x; 88 | modify(); 89 | } 90 | 91 | 92 | public OO7_CompositePart partOf() { 93 | return thePartOf; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/PatriciaTrie.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | import java.util.*; 4 | 5 | /** 6 | * PATRICIA trie (Practical Algorithm To Retrieve Information Coded In Alphanumeric). 7 | * Tries are a kind of tree where each node holds a common part of one or more keys. 8 | * PATRICIA trie is one of the many existing variants of the trie, which adds path compression 9 | * by grouping common sequences of nodes together.
10 | * This structure provides a very efficient way of storing values while maintaining the lookup time 11 | * for a key in O(N) in the worst case, where N is the length of the longest key. 12 | * This structure has it's main use in IP routing software, but can provide an interesting alternative 13 | * to other structures such as hashtables when memory space is of concern. 14 | */ 15 | public interface PatriciaTrie extends IPersistent, IResource, Collection { 16 | /** 17 | * Add new key to the trie 18 | * @param key bit vector 19 | * @param obj persistent object associated with this key 20 | * @return previous object associtated with this key or null if there 21 | * was no such object 22 | */ 23 | T add(PatriciaTrieKey key, T obj); 24 | 25 | /** 26 | * Find best match with specified key 27 | * @param key bit vector 28 | * @return object associated with this deepest possible match with specified key 29 | */ 30 | T findBestMatch(PatriciaTrieKey key); 31 | 32 | /** 33 | * Find exact match with specified key 34 | * @param key bit vector 35 | * @return object associated with this key or NULL if match is not found 36 | */ 37 | T findExactMatch(PatriciaTrieKey key); 38 | 39 | /** 40 | * Removes key from the triesKFind exact match with specified key 41 | * @param key bit vector 42 | * @return object associated with removed key or null if such key is not found 43 | */ 44 | T remove(PatriciaTrieKey key); 45 | 46 | /** 47 | * Clear the trie: remove all elements from trie 48 | */ 49 | void clear(); 50 | 51 | /** 52 | * Get list of all elements in the Trie 53 | * @return list of all elements 54 | */ 55 | ArrayList elements(); 56 | } -------------------------------------------------------------------------------- /csharp/src/DatabaseFactory.cs: -------------------------------------------------------------------------------- 1 | namespace Volante 2 | { 3 | using System; 4 | using Volante.Impl; 5 | 6 | /// Database factory 7 | /// 8 | public class DatabaseFactory 9 | { 10 | /// Create a database instance 11 | /// 12 | public static IDatabase CreateDatabase() 13 | { 14 | #if CF 15 | return new DatabaseImpl(System.Reflection.Assembly.GetCallingAssembly()); 16 | #else 17 | return new DatabaseImpl(); 18 | #endif 19 | } 20 | 21 | #if !CF && WITH_REPLICATION 22 | /// 23 | /// Create new instance of the master node of replicated database 24 | /// 25 | /// addresses of hosts to which replication will be performed. 26 | /// Address as specified as NAME:PORT 27 | /// if value of this parameter is greater than zero then replication will be 28 | /// asynchronous, done by separate thread and not blocking main application. 29 | /// Otherwise data is send to the slave nodes by the same thread which updates the database. 30 | /// If space asynchronous buffer is exhausted, then main thread willbe also blocked until the 31 | /// data is send. 32 | /// new instance of the master database (unopened, you should explicitely invoke open method) 33 | /// 34 | public static ReplicationMasterDatabase CreateReplicationMasterDatabase(string[] replicationSlaveNodes, int asyncBufSize) 35 | { 36 | return new ReplicationMasterDatabaseImpl(replicationSlaveNodes, asyncBufSize); 37 | } 38 | 39 | /// 40 | /// Create new instance of the slave node of replicated database 41 | /// 42 | /// socket port at which connection from master will be established 43 | /// new instance of the slave db (unopened, you should explicitely invoke open method) 44 | //// 45 | public static ReplicationSlaveDatabase CreateReplicationSlaveDatabase(int port) 46 | { 47 | return new ReplicationSlaveDatabaseImpl(port); 48 | } 49 | #endif 50 | } 51 | } -------------------------------------------------------------------------------- /java/src/org/nachodb/StorageFactory.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | import org.nachodb.impl.*; 3 | 4 | /** 5 | * Storage factory 6 | */ 7 | public class StorageFactory { 8 | /** 9 | * Create new instance of the storage 10 | * @return new instance of the storage (unopened, you should explicitely invoke open method) 11 | */ 12 | public Storage createStorage() { 13 | return new StorageImpl(); 14 | } 15 | 16 | /** 17 | * Create new instance of the master node of replicated storage 18 | * @param replicationSlaveNodes addresses of hosts to which replication will be performed. 19 | * Address as specified as NAME:PORT 20 | * @param asyncBufSize if value of this parameter is greater than zero then replication will be 21 | * asynchronous, done by separate thread and not blocking main application. 22 | * Otherwise data is send to the slave nodes by the same thread which updates the database. 23 | * If space asynchronous buffer is exhausted, then main thread willbe also blocked until the 24 | * data is send. 25 | * @return new instance of the master storage (unopened, you should explicitely invoke open method) 26 | */ 27 | public ReplicationMasterStorage createReplicationMasterStorage(String[] replicationSlaveNodes, int asyncBufSize) { 28 | return new ReplicationMasterStorageImpl(replicationSlaveNodes, asyncBufSize); 29 | } 30 | 31 | /** 32 | * Create new instance of the slave node of replicated storage 33 | * @param port socket port at which connection from master will be established 34 | * @return new instance of the slave storage (unopened, you should explicitely invoke open method) 35 | */ 36 | public ReplicationSlaveStorage createReplicationSlaveStorage(int port) { 37 | return new ReplicationSlaveStorageImpl(port); 38 | } 39 | 40 | /** 41 | * Get instance of storage factory. 42 | * So new storages should be create in application in the following way: 43 | * StorageFactory.getInstance().createStorage() 44 | * @return instance of the storage factory 45 | */ 46 | public static StorageFactory getInstance() { 47 | return instance; 48 | } 49 | 50 | protected static final StorageFactory instance = new StorageFactory(); 51 | }; 52 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/StorageFactory.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | import org.nachodb.impl.*; 3 | 4 | /** 5 | * Storage factory 6 | */ 7 | public class StorageFactory { 8 | /** 9 | * Create new instance of the storage 10 | * @return new instance of the storage (unopened, you should explicitely invoke open method) 11 | */ 12 | public Storage createStorage() { 13 | return new StorageImpl(); 14 | } 15 | 16 | /** 17 | * Create new instance of the master node of replicated storage 18 | * @param replicationSlaveNodes addresses of hosts to which replication will be performed. 19 | * Address as specified as NAME:PORT 20 | * @param asyncBufSize if value of this parameter is greater than zero then replication will be 21 | * asynchronous, done by separate thread and not blocking main application. 22 | * Otherwise data is send to the slave nodes by the same thread which updates the database. 23 | * If space asynchronous buffer is exhausted, then main thread willbe also blocked until the 24 | * data is send. 25 | * @return new instance of the master storage (unopened, you should explicitely invoke open method) 26 | */ 27 | public ReplicationMasterStorage createReplicationMasterStorage(String[] replicationSlaveNodes, int asyncBufSize) { 28 | return new ReplicationMasterStorageImpl(replicationSlaveNodes, asyncBufSize); 29 | } 30 | 31 | /** 32 | * Create new instance of the slave node of replicated storage 33 | * @param port socket port at which connection from master will be established 34 | * @return new instance of the slave storage (unopened, you should explicitely invoke open method) 35 | */ 36 | public ReplicationSlaveStorage createReplicationSlaveStorage(int port) { 37 | return new ReplicationSlaveStorageImpl(port); 38 | } 39 | 40 | /** 41 | * Get instance of storage factory. 42 | * So new storages should be create in application in the following way: 43 | * StorageFactory.getInstance().createStorage() 44 | * @return instance of the storage factory 45 | */ 46 | public static StorageFactory getInstance() { 47 | return instance; 48 | } 49 | 50 | protected static final StorageFactory instance = new StorageFactory(); 51 | }; 52 | -------------------------------------------------------------------------------- /csharp/tests/Tests/TestIndex4.cs: -------------------------------------------------------------------------------- 1 | namespace Volante 2 | { 3 | using System; 4 | using System.Collections; 5 | 6 | public class TestIndex4 : ITest 7 | { 8 | public class StringInt : Persistent 9 | { 10 | public string s; 11 | public int no; 12 | public StringInt() 13 | { 14 | } 15 | public StringInt(string s, int no) 16 | { 17 | this.s = s; 18 | this.no = no; 19 | } 20 | } 21 | 22 | public static void CheckStrings(IIndex root, string[] strs, int count) 23 | { 24 | int no = 1; 25 | for (var i = 0; i < count; i++) 26 | { 27 | foreach (string s in strs) 28 | { 29 | var s2 = String.Format("{0}-{1}", s, i); 30 | StringInt o = root[s2]; 31 | Tests.Assert(o.no == no++); 32 | } 33 | } 34 | } 35 | 36 | public void Run(TestConfig config) 37 | { 38 | int count = config.Count; 39 | var res = new TestResult(); 40 | config.Result = res; 41 | IDatabase db = config.GetDatabase(); 42 | IIndex root = (IIndex)db.Root; 43 | Tests.Assert(null == root); 44 | root = db.CreateIndex(IndexType.Unique); 45 | db.Root = root; 46 | 47 | string[] strs = new string[] { "one", "two", "three", "four" }; 48 | int no = 1; 49 | for (var i = 0; i < count; i++) 50 | { 51 | foreach (string s in strs) 52 | { 53 | var s2 = String.Format("{0}-{1}", s, i); 54 | var o = new StringInt(s, no++); 55 | root[s2] = o; 56 | } 57 | } 58 | 59 | CheckStrings(root, strs, count); 60 | db.Close(); 61 | 62 | db = config.GetDatabase(false); 63 | root = (IIndex)db.Root; 64 | Tests.Assert(null != root); 65 | CheckStrings(root, strs, count); 66 | db.Close(); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /csharp/doc/index_set.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Set 9 | 10 | 11 | 12 |
13 |
14 |
15 |
16 |
17 | 18 |
19 |

Volante : Volante Developer's Guide : Set

20 | 21 |

A set is an unordered collection of non-duplicate objects. To create a set: 22 |

    23 |
  • ISet<T> CreateSet<T>()
  • 24 |
  • ISet<T> CreateSet<T>(int initialSize)
  • 25 |
26 |

27 | 28 |

Basic set operations are adding an object to a set and checking if an object in the set exists.

29 | 30 |

ISet implements the standard ICollection<T> interface and provides a few additions.

31 | 32 |

To add objects to the set, use bool AddAll(ICollection<T> c). Since this is a set, if object already exists in the set, it won't get added again. AddAll() returns true if at least one object from the collection was added.

33 | 34 |

To remove objects from the set, use bool RemoveAll(ICollection<T> c).

35 | 36 |

To check if objects exist in the set, use bool ContainsAll(ICollection<T> c). It returns true if all objects exist in the collection.

37 | 38 |

You can also get all objects as an array with T[] ToArray(). This is expensive if there are many objects in the set.

39 | 40 |
← sorted collection  •  time series →
41 | 42 |
43 |
Volante is maintained by Krzysztof Kowalczyk
44 | 45 |
46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/BitIndex.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | import java.util.*; 4 | 5 | /** 6 | * Interface of bit index. 7 | * Bit index allows to efficiently search object with specified 8 | * set of properties. Each object has associated mask of 32 bites. 9 | * Meaning of bits is application dependent. Usually each bit stands for 10 | * some binary or boolean property, for example "sex", but it is possible to 11 | * use group of bits to represent enumerations with more possible values. 12 | */ 13 | public interface BitIndex extends IPersistent, IResource, Collection { 14 | /** 15 | * Get properties of specified object 16 | * @param obj object which properties are requested 17 | * @return bit mask associated with this objects 18 | * @exception StorageError(StorageError.KEY_NOT_FOUND) exception if there is no object in the index 19 | */ 20 | public int get(T obj); 21 | 22 | /** 23 | * Put new object in the index. If such object already exists in index, then its 24 | * mask will be rewritten 25 | * @param obj object placed in the index. Object can be not yet persistent, in this case 26 | * its forced to become persistent by assigning OID to it. 27 | * @param mask bit mask associated with this objects 28 | */ 29 | public void put(T obj, int mask); 30 | 31 | /** 32 | * Remove object from the index 33 | * @param obj object removed from the index 34 | * @exception StorageError(StorageError.KEY_NOT_FOUND) exception if there is no such key in the index 35 | */ 36 | public void remove(T obj); 37 | 38 | /** 39 | * Get number of objects in the index 40 | * @return number of objects in the index 41 | */ 42 | public int size(); 43 | 44 | /** 45 | * Remove all objects from the index 46 | */ 47 | public void clear(); 48 | 49 | /** 50 | * Get iterator for selecting objects with specified properties. 51 | * To select all record this method should be invoked with (0, 0) parameters 52 | * @param set bitmask specifying bits which should be set (1) 53 | * @param clear bitmask specifying bits which should be cleared (0) 54 | * @return selection iterator 55 | */ 56 | public IterableIterator iterator(int set, int clear); 57 | } 58 | 59 | 60 | -------------------------------------------------------------------------------- /csharp/doc/devguideindex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Volante - object-oriented, embeddable database for C# 7 | 8 | 9 |
10 |
11 |
12 |
13 |
14 | 15 |
16 |

Volante : Volante Developer's Guide

17 | 18 |

Volante Developer's Guide

19 | 20 | 48 | 49 |
50 |
Volante is maintained by Krzysztof Kowalczyk
51 | 52 |
53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /csharp/src/IPatriciaTrie.cs: -------------------------------------------------------------------------------- 1 | #if WITH_PATRICIA 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | 6 | namespace Volante 7 | { 8 | /// 9 | /// Trie is a kind of tree where each node holds a common part of one or more keys. 10 | /// Patricia trie is one of the many existing variants of the trie, which adds path 11 | /// compression by grouping common sequences of nodes together. 12 | /// This structure provides a very efficient way of storing values while maintaining 13 | /// the lookup time for a key in O(N) in the worst case, where N is the length of 14 | /// the longest key. This structure has it's main use in IP routing software, but 15 | /// can provide an interesting alternative to other structures such as hashtables 16 | /// when memory space is of concern. 17 | public interface IPatriciaTrie : IPersistent, IResource, ICollection where T : class,IPersistent 18 | { 19 | /// 20 | /// Add new key to the trie 21 | /// 22 | /// bit vector 23 | /// persistent object associated with this key 24 | /// previous object associtated with this key or null if there 25 | /// was no such object 26 | T Add(PatriciaTrieKey key, T obj); 27 | 28 | /// 29 | /// Find best match with specified key 30 | /// 31 | /// bit vector 32 | /// object associated with this deepest possible match with specified key 33 | T FindBestMatch(PatriciaTrieKey key); 34 | 35 | /// 36 | /// Find exact match with specified key 37 | /// 38 | /// bit vector 39 | /// object associated with this key or NULL if match is not found 40 | T FindExactMatch(PatriciaTrieKey key); 41 | 42 | /// 43 | /// Removes key from the triesKFind exact match with specified key 44 | /// 45 | /// bit vector 46 | /// object associated with removed key or null if such key is not found 47 | T Remove(PatriciaTrieKey key); 48 | } 49 | } 50 | #endif 51 | -------------------------------------------------------------------------------- /java/src/org/nachodb/impl/RelationImpl.java: -------------------------------------------------------------------------------- 1 | package org.nachodb.impl; 2 | import org.nachodb.*; 3 | import java.util.Iterator; 4 | 5 | public class RelationImpl extends Relation { 6 | public int size() { 7 | return link.size(); 8 | } 9 | 10 | public void setSize(int newSize) { 11 | link.setSize(newSize); 12 | } 13 | 14 | public IPersistent get(int i) { 15 | return link.get(i); 16 | } 17 | 18 | public IPersistent getRaw(int i) { 19 | return link.getRaw(i); 20 | } 21 | 22 | public void set(int i, IPersistent obj) { 23 | link.set(i, obj); 24 | } 25 | 26 | public void remove(int i) { 27 | link.remove(i); 28 | } 29 | 30 | public void insert(int i, IPersistent obj) { 31 | link.insert(i, obj); 32 | } 33 | 34 | public void add(IPersistent obj) { 35 | link.add(obj); 36 | } 37 | 38 | public void addAll(IPersistent[] arr) { 39 | link.addAll(arr); 40 | } 41 | 42 | public void addAll(IPersistent[] arr, int from, int length) { 43 | link.addAll(arr, from, length); 44 | } 45 | 46 | public void addAll(Link anotherLink) { 47 | link.addAll(anotherLink); 48 | } 49 | 50 | public IPersistent[] toArray() { 51 | return link.toArray(); 52 | } 53 | 54 | public IPersistent[] toRawArray() { 55 | return link.toRawArray(); 56 | } 57 | 58 | public IPersistent[] toArray(IPersistent[] arr) { 59 | return link.toArray(arr); 60 | } 61 | 62 | public boolean contains(IPersistent obj) { 63 | return link.contains(obj); 64 | } 65 | 66 | public int indexOf(IPersistent obj) { 67 | return link.indexOf(obj); 68 | } 69 | 70 | public boolean containsElement(int i, IPersistent obj) { 71 | return link.containsElement(i, obj); 72 | } 73 | 74 | public void clear() { 75 | link.clear(); 76 | } 77 | 78 | public Iterator iterator() { 79 | return link.iterator(); 80 | } 81 | 82 | public void pin() { 83 | link.pin(); 84 | } 85 | 86 | public void unpin() { 87 | link.unpin(); 88 | } 89 | 90 | RelationImpl() {} 91 | 92 | RelationImpl(IPersistent owner) { 93 | super(owner); 94 | link = new LinkImpl(8); 95 | } 96 | 97 | Link link; 98 | } 99 | -------------------------------------------------------------------------------- /csharp/tests/Tests/TestGC.cs: -------------------------------------------------------------------------------- 1 | namespace Volante 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | public class TestGcResult : TestResult 7 | { 8 | } 9 | 10 | public class TestGc : ITest 11 | { 12 | class PObject : Persistent 13 | { 14 | internal long intKey; 15 | internal PObject next; 16 | internal String strKey; 17 | } 18 | 19 | class Root : Persistent 20 | { 21 | internal PObject list; 22 | internal IIndex strIndex; 23 | internal IIndex intIndex; 24 | } 25 | 26 | const int nObjectsInTree = 10000; 27 | 28 | public void Run(TestConfig config) 29 | { 30 | int count = config.Count; 31 | var res = new TestGcResult(); 32 | config.Result = res; 33 | IDatabase db = config.GetDatabase(); 34 | Root root = new Root(); 35 | IIndex strIndex = root.strIndex = db.CreateIndex(IndexType.Unique); 36 | IIndex intIndex = root.intIndex = db.CreateIndex(IndexType.Unique); 37 | db.Root = root; 38 | long insKey = 1999; 39 | long remKey = 1999; 40 | 41 | for (int i = 0; i < count; i++) 42 | { 43 | if (i > nObjectsInTree) 44 | { 45 | remKey = (3141592621L * remKey + 2718281829L) % 1000000007L; 46 | intIndex.Remove(new Key(remKey)); 47 | strIndex.Remove(new Key(remKey.ToString())); 48 | } 49 | PObject obj = new PObject(); 50 | insKey = (3141592621L * insKey + 2718281829L) % 1000000007L; 51 | obj.intKey = insKey; 52 | obj.strKey = insKey.ToString(); 53 | obj.next = new PObject(); 54 | intIndex[obj.intKey] = obj; 55 | strIndex[obj.strKey] = obj; 56 | if (i > 0) 57 | { 58 | Tests.Assert(root.list.intKey == i - 1); 59 | } 60 | root.list = new PObject(); 61 | root.list.intKey = i; 62 | root.Store(); 63 | if (i % 1000 == 0) 64 | db.Commit(); 65 | } 66 | db.Close(); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /csharp/src/DatabaseListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Volante 4 | { 5 | /// 6 | /// Listener of database events. Programmer should derive his own subclass and register 7 | /// it using IDatabase.Listener property. 8 | /// 9 | public abstract class DatabaseListener 10 | { 11 | /// 12 | /// Called if database was detected to be corrupted during openinig 13 | /// (when database was not closed properly and has to be recovered) 14 | /// 15 | public virtual void DatabaseCorrupted() { } 16 | 17 | /// 18 | /// Called after database recovery has completed 19 | /// 20 | public virtual void RecoveryCompleted() { } 21 | 22 | /// 23 | /// Called when garbage collection is started, either explicitly 24 | /// (by calling IDatabase.Gc()) or implicitly (after allocating 25 | /// enough memory to trigger gc threshold) 26 | /// 27 | public virtual void GcStarted() { } 28 | 29 | /// 30 | /// Called when garbage collection is completed 31 | /// 32 | /// number of deallocated objects 33 | /// 34 | public virtual void GcCompleted(int nDeallocatedObjects) { } 35 | 36 | /// 37 | /// Called when unreferenced object is deallocated from 38 | /// database. It is possible to get instance of the object using 39 | /// IDatabase.GetObjectByOid() method. 40 | /// 41 | /// class of deallocated object 42 | /// object identifier of deallocated object 43 | /// 44 | public virtual void DeallocateObject(Type cls, int oid) { } 45 | 46 | /// 47 | /// Handle replication error 48 | /// 49 | /// address of host replication to which is failed (null if error jappens at slave node) 50 | /// true if host should be reconnected and attempt to send data to it should be 51 | /// repeated, false if no more attmpts to communicate with this host should be performed 52 | /// 53 | public virtual bool ReplicationError(string host) 54 | { 55 | return false; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /csharp/src/Relation.cs: -------------------------------------------------------------------------------- 1 | namespace Volante 2 | { 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | 7 | /// Class representing relation between owner and members 8 | /// 9 | public abstract class Relation : PersistentCollection, ILink 10 | where M : class,IPersistent 11 | where O : class,IPersistent 12 | { 13 | public abstract int Size(); 14 | 15 | public abstract int Length 16 | { 17 | get; 18 | set; 19 | } 20 | 21 | public abstract M this[int i] 22 | { 23 | get; 24 | set; 25 | } 26 | 27 | public abstract M Get(int i); 28 | 29 | public abstract IPersistent GetRaw(int i); 30 | 31 | public abstract void Set(int i, M obj); 32 | 33 | public abstract void RemoveAt(int i); 34 | 35 | public abstract void Insert(int i, M obj); 36 | 37 | public abstract void AddAll(M[] arr); 38 | 39 | public abstract void AddAll(M[] arr, int from, int length); 40 | 41 | public abstract void AddAll(ILink anotherLink); 42 | 43 | public abstract M[] ToArray(); 44 | 45 | public abstract Array ToRawArray(); 46 | 47 | public abstract bool ContainsElement(int i, M obj); 48 | 49 | public abstract int IndexOf(M obj); 50 | 51 | public abstract void Pin(); 52 | 53 | public abstract void Unpin(); 54 | 55 | /// Get or set relation owner 56 | /// 57 | public virtual O Owner 58 | { 59 | get 60 | { 61 | return owner; 62 | } 63 | 64 | set 65 | { 66 | this.owner = value; 67 | Modify(); 68 | } 69 | } 70 | 71 | /// Relation constructor. Creates empty relation with specified owner and no members. 72 | /// Members can be added to the relation later. 73 | /// 74 | /// owner of the relation 75 | /// 76 | /// 77 | public Relation(O owner) 78 | { 79 | this.owner = owner; 80 | } 81 | 82 | internal Relation() { } 83 | 84 | public void SetOwner(IPersistent obj) 85 | { 86 | owner = (O)obj; 87 | } 88 | 89 | private O owner; 90 | } 91 | } -------------------------------------------------------------------------------- /java/src/org/nachodb/BitIndex.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | 3 | import java.util.Iterator; 4 | 5 | /** 6 | * Interface of bit index. 7 | * Bit index allows to effiicently search object with specified 8 | * set of properties. Each object has associated mask of 32 bites. 9 | * Meaning of bits is application dependent. Usually each bit stands for 10 | * some binary or boolean property, for example "sex", but it is possible to 11 | * use group of bits to represent enumerations with more possible values. 12 | */ 13 | public interface BitIndex extends IPersistent, IResource { 14 | /** 15 | * Get properties of specified object 16 | * @param obj object which properties are requested 17 | * @return bit mask associated with this objects 18 | * @exception StorageError(StorageError.KEY_NOT_FOUND) exception if there is no object in the index 19 | */ 20 | public int get(IPersistent obj); 21 | 22 | /** 23 | * Put new object in the index. If such objct already exists in index, then its 24 | * mask will be rewritten 25 | * @param obj object to be placed in the index. Object can be not yet persistent, in this case 26 | * its forced to become persistent by assigning OID to it. 27 | * @param mask bit mask associated with this objects 28 | */ 29 | public void put(IPersistent obj, int mask); 30 | 31 | 32 | /** 33 | * Remove object from the index 34 | * @param obj object removed from the index 35 | * @exception StorageError(StorageError.KEY_NOT_FOUND) exception if there is no such object in the index 36 | */ 37 | public void remove(IPersistent obj); 38 | 39 | /** 40 | * Get number of objects in the index 41 | * @return number of objects in the index 42 | */ 43 | public int size(); 44 | 45 | /** 46 | * Remove all objects from the index 47 | */ 48 | public void clear(); 49 | 50 | /** 51 | * Get iterator for selecting objects with specified properties. 52 | * To select all record this method should be invoked with (0, 0) parameters 53 | * @param set bitmask specifying bits which should be set (1) 54 | * @param clear bitmask specifying bits which should be cleared (0) 55 | * @return selection iterator 56 | */ 57 | public Iterator iterator(int set, int clear); 58 | 59 | /** 60 | * Get iterator through all objects in the index 61 | * @return iterator through all objects in the index 62 | */ 63 | public Iterator iterator(); 64 | } 65 | 66 | 67 | -------------------------------------------------------------------------------- /java/src15/org/nachodb/PersistentCollection.java: -------------------------------------------------------------------------------- 1 | package org.nachodb; 2 | import org.nachodb.*; 3 | import java.util.*; 4 | 5 | public abstract class PersistentCollection extends PersistentResource implements Collection 6 | { 7 | public boolean containsAll(Collection c) { 8 | Iterator e = c.iterator(); 9 | while (e.hasNext()) 10 | if(!contains(e.next())) 11 | return false; 12 | return true; 13 | } 14 | 15 | public boolean addAll(Collection c) { 16 | boolean modified = false; 17 | Iterator e = c.iterator(); 18 | while (e.hasNext()) { 19 | if (add(e.next())) 20 | modified = true; 21 | } 22 | return modified; 23 | } 24 | 25 | public boolean removeAll(Collection c) { 26 | boolean modified = false; 27 | Iterator i = c.iterator(); 28 | while (i.hasNext()) { 29 | modified |= remove(i.next()); 30 | } 31 | return modified; 32 | } 33 | 34 | public boolean retainAll(Collection c) { 35 | ArrayList toBeRemoved = new ArrayList(); 36 | Iterator i = iterator(); 37 | while (i.hasNext()) { 38 | T o = i.next(); 39 | if (!c.contains(o)) { 40 | toBeRemoved.add(o); 41 | } 42 | } 43 | int n = toBeRemoved.size(); 44 | for (int j = 0; j < n; j++) { 45 | remove(toBeRemoved.get(j)); 46 | } 47 | return n != 0; 48 | } 49 | 50 | public boolean contains(Object o) { 51 | Iterator e = iterator(); 52 | if (o==null) { 53 | while (e.hasNext()) 54 | if (e.next()==null) 55 | return true; 56 | } else { 57 | while (e.hasNext()) 58 | if (o.equals(e.next())) 59 | return true; 60 | } 61 | return false; 62 | } 63 | 64 | public boolean remove(Object o) { 65 | Iterator e = iterator(); 66 | if (o==null) { 67 | while (e.hasNext()) { 68 | if (e.next()==null) { 69 | e.remove(); 70 | return true; 71 | } 72 | } 73 | } else { 74 | while (e.hasNext()) { 75 | if (o.equals(e.next())) { 76 | e.remove(); 77 | return true; 78 | } 79 | } 80 | } 81 | return false; 82 | } 83 | 84 | public boolean add(T o) { 85 | throw new UnsupportedOperationException(); 86 | } 87 | 88 | public boolean isEmpty() { 89 | return size() == 0; 90 | } 91 | 92 | public PersistentCollection() {} 93 | 94 | public PersistentCollection(Storage storage) { 95 | super(storage); 96 | } 97 | } 98 | --------------------------------------------------------------------------------