From 5e3c938e1c166f5f1256e5f57847162813c79674 Mon Sep 17 00:00:00 2001 From: Philippe PRADOS Date: Tue, 18 Jul 2017 18:53:32 +0200 Subject: [PATCH 1/3] - Fixe some bugs - Add comments - Update the code to be compatible with Scala - Add serialVersionUID - Add some caches --- .gitignore | 6 + .../lib/llpl/FlushableMemoryRegionTest.java | 4 +- .../java/lib/llpl/RawMemoryRegionTest.java | 4 +- .../llpl/TransactionalMemoryRegionTest.java | 114 ++++----- doc/allclasses-frame.html | 6 +- doc/allclasses-noframe.html | 6 +- doc/constant-values.html | 6 +- doc/deprecated-list.html | 6 +- doc/help-doc.html | 6 +- doc/index-all.html | 6 +- doc/index.html | 4 +- doc/lib/util/persistent/Box.html | 6 +- doc/lib/util/persistent/CycleCollector.html | 6 +- doc/lib/util/persistent/Header.html | 6 +- doc/lib/util/persistent/Long256.html | 6 +- doc/lib/util/persistent/MemoryRegion.html | 6 +- doc/lib/util/persistent/ObjectCache.PRef.html | 6 +- doc/lib/util/persistent/ObjectCache.Ref.html | 6 +- doc/lib/util/persistent/ObjectCache.html | 6 +- doc/lib/util/persistent/ObjectDirectory.html | 6 +- doc/lib/util/persistent/ObjectPointer.html | 6 +- .../util/persistent/PersistenceException.html | 6 +- doc/lib/util/persistent/Persistent.html | 6 +- doc/lib/util/persistent/PersistentArray.html | 6 +- .../PersistentArrayList.Statics.html | 6 +- .../util/persistent/PersistentArrayList.html | 6 +- doc/lib/util/persistent/PersistentArrays.html | 6 +- .../persistent/PersistentAtomicReference.html | 6 +- .../util/persistent/PersistentBoolean.html | 6 +- .../persistent/PersistentBooleanArray.html | 6 +- doc/lib/util/persistent/PersistentByte.html | 6 +- .../util/persistent/PersistentByteArray.html | 6 +- .../util/persistent/PersistentCharArray.html | 6 +- .../util/persistent/PersistentCharacter.html | 6 +- doc/lib/util/persistent/PersistentDouble.html | 6 +- .../persistent/PersistentDoubleArray.html | 6 +- doc/lib/util/persistent/PersistentFloat.html | 6 +- .../util/persistent/PersistentFloatArray.html | 6 +- .../persistent/PersistentHashMap.Node.html | 6 +- .../util/persistent/PersistentHashMap.html | 6 +- doc/lib/util/persistent/PersistentHeap.html | 6 +- .../persistent/PersistentImmutableArray.html | 6 +- .../PersistentImmutableBooleanArray.html | 6 +- .../PersistentImmutableByteArray.html | 6 +- .../PersistentImmutableCharArray.html | 6 +- .../PersistentImmutableDoubleArray.html | 6 +- .../PersistentImmutableFloatArray.html | 6 +- .../PersistentImmutableIntArray.html | 6 +- .../PersistentImmutableLongArray.html | 6 +- .../PersistentImmutableShortArray.html | 6 +- .../persistent/PersistentImmutableTuple1.html | 6 +- .../PersistentImmutableTuple10.html | 6 +- .../PersistentImmutableTuple11.html | 6 +- .../PersistentImmutableTuple12.html | 6 +- .../PersistentImmutableTuple13.html | 6 +- .../PersistentImmutableTuple14.html | 6 +- .../PersistentImmutableTuple15.html | 6 +- .../PersistentImmutableTuple16.html | 6 +- .../PersistentImmutableTuple17.html | 6 +- .../PersistentImmutableTuple18.html | 6 +- .../PersistentImmutableTuple19.html | 6 +- .../persistent/PersistentImmutableTuple2.html | 6 +- .../PersistentImmutableTuple20.html | 6 +- .../PersistentImmutableTuple21.html | 6 +- .../PersistentImmutableTuple22.html | 6 +- .../persistent/PersistentImmutableTuple3.html | 6 +- .../persistent/PersistentImmutableTuple4.html | 6 +- .../persistent/PersistentImmutableTuple5.html | 6 +- .../persistent/PersistentImmutableTuple6.html | 6 +- .../persistent/PersistentImmutableTuple7.html | 6 +- .../persistent/PersistentImmutableTuple8.html | 6 +- .../persistent/PersistentImmutableTuple9.html | 6 +- .../util/persistent/PersistentIntArray.html | 6 +- .../util/persistent/PersistentInteger.html | 6 +- .../PersistentLinkedList.PersistentEntry.html | 6 +- .../util/persistent/PersistentLinkedList.html | 6 +- .../PersistentLinkedQueue.PersistentNode.html | 6 +- .../persistent/PersistentLinkedQueue.html | 6 +- doc/lib/util/persistent/PersistentLong.html | 6 +- .../util/persistent/PersistentLongArray.html | 6 +- doc/lib/util/persistent/PersistentObject.html | 6 +- doc/lib/util/persistent/PersistentShort.html | 6 +- .../util/persistent/PersistentShortArray.html | 6 +- .../PersistentSkipListMap.HeadIndex.html | 6 +- .../PersistentSkipListMap.Index.html | 6 +- .../PersistentSkipListMap.Node.html | 6 +- .../PersistentSkipListMap.Statics.html | 6 +- .../persistent/PersistentSkipListMap.html | 8 +- doc/lib/util/persistent/PersistentString.html | 6 +- doc/lib/util/persistent/PersistentTuple1.html | 6 +- .../util/persistent/PersistentTuple10.html | 6 +- .../util/persistent/PersistentTuple11.html | 6 +- .../util/persistent/PersistentTuple12.html | 6 +- .../util/persistent/PersistentTuple13.html | 6 +- .../util/persistent/PersistentTuple14.html | 6 +- .../util/persistent/PersistentTuple15.html | 6 +- .../util/persistent/PersistentTuple16.html | 6 +- .../util/persistent/PersistentTuple17.html | 6 +- .../util/persistent/PersistentTuple18.html | 6 +- .../util/persistent/PersistentTuple19.html | 6 +- doc/lib/util/persistent/PersistentTuple2.html | 6 +- .../util/persistent/PersistentTuple20.html | 6 +- .../util/persistent/PersistentTuple21.html | 6 +- .../util/persistent/PersistentTuple22.html | 6 +- doc/lib/util/persistent/PersistentTuple3.html | 6 +- doc/lib/util/persistent/PersistentTuple4.html | 6 +- doc/lib/util/persistent/PersistentTuple5.html | 6 +- doc/lib/util/persistent/PersistentTuple6.html | 6 +- doc/lib/util/persistent/PersistentTuple7.html | 6 +- doc/lib/util/persistent/PersistentTuple8.html | 6 +- doc/lib/util/persistent/PersistentTuple9.html | 6 +- doc/lib/util/persistent/PersistentValue.html | 6 +- .../util/persistent/PersistentValueArray.html | 6 +- doc/lib/util/persistent/Root.html | 6 +- doc/lib/util/persistent/Stats.LockStats.html | 6 +- .../persistent/Stats.ObjectCacheStats.html | 6 +- .../persistent/Stats.TransactionStats.html | 6 +- doc/lib/util/persistent/Stats.html | 6 +- doc/lib/util/persistent/Trace.html | 6 +- .../util/persistent/Transaction.State.html | 6 +- .../util/persistent/Transaction.Update.html | 6 +- doc/lib/util/persistent/Transaction.html | 6 +- doc/lib/util/persistent/TransactionError.html | 6 +- .../util/persistent/TransactionException.html | 6 +- .../persistent/TransactionRetryException.html | 6 +- doc/lib/util/persistent/ValuePointer.html | 6 +- .../persistent/front/PersistentClass.html | 6 +- doc/lib/util/persistent/front/Processor.html | 6 +- .../util/persistent/front/package-frame.html | 6 +- .../persistent/front/package-summary.html | 6 +- .../util/persistent/front/package-tree.html | 6 +- doc/lib/util/persistent/package-frame.html | 6 +- doc/lib/util/persistent/package-summary.html | 6 +- doc/lib/util/persistent/package-tree.html | 6 +- .../spi/PersistentMemoryProvider.html | 6 +- .../util/persistent/spi/package-frame.html | 6 +- .../util/persistent/spi/package-summary.html | 6 +- doc/lib/util/persistent/spi/package-tree.html | 6 +- doc/lib/util/persistent/types/ArrayType.html | 6 +- .../util/persistent/types/BooleanField.html | 6 +- doc/lib/util/persistent/types/ByteField.html | 6 +- doc/lib/util/persistent/types/Carried.html | 6 +- .../util/persistent/types/CarriedType.html | 6 +- doc/lib/util/persistent/types/CharField.html | 6 +- doc/lib/util/persistent/types/Container.html | 6 +- .../util/persistent/types/DoubleField.html | 6 +- doc/lib/util/persistent/types/FloatField.html | 6 +- doc/lib/util/persistent/types/Indexed.html | 6 +- doc/lib/util/persistent/types/IntField.html | 6 +- doc/lib/util/persistent/types/LongField.html | 6 +- doc/lib/util/persistent/types/Named.html | 6 +- .../util/persistent/types/ObjectField.html | 6 +- doc/lib/util/persistent/types/ObjectType.html | 6 +- .../persistent/types/PersistentField.html | 6 +- .../util/persistent/types/PersistentType.html | 6 +- .../util/persistent/types/PrimitiveType.html | 6 +- doc/lib/util/persistent/types/ShortField.html | 6 +- .../util/persistent/types/StringField.html | 6 +- doc/lib/util/persistent/types/Types.html | 6 +- .../util/persistent/types/ValueArrayType.html | 6 +- doc/lib/util/persistent/types/ValueField.html | 6 +- doc/lib/util/persistent/types/ValueType.html | 6 +- .../util/persistent/types/package-frame.html | 6 +- .../persistent/types/package-summary.html | 6 +- .../util/persistent/types/package-tree.html | 6 +- .../UncheckedPersistentMemoryRegion.html | 6 +- doc/lib/xpersistent/XHeap.html | 6 +- doc/lib/xpersistent/XPersistent.html | 6 +- doc/lib/xpersistent/XPersistentMemory.html | 6 +- doc/lib/xpersistent/XRoot.html | 6 +- doc/lib/xpersistent/XTransaction.html | 6 +- doc/lib/xpersistent/package-frame.html | 6 +- doc/lib/xpersistent/package-summary.html | 6 +- doc/lib/xpersistent/package-tree.html | 6 +- doc/overview-frame.html | 6 +- doc/overview-summary.html | 6 +- doc/overview-tree.html | 6 +- doc/serialized-form.html | 6 +- lib/tools/ArraysGen.java | 3 +- lib/tools/PrimitivesGen.java | 1 - lib/tools/code.stg | 32 ++- src/examples/database/Database.java | 1 + .../persistent/AbstractPersistentArray.java | 26 +- .../AbstractPersistentImmutableArray.java | 10 +- .../lib/util/persistent/CycleCollector.java | 4 + src/main/java/lib/util/persistent/Header.java | 2 +- .../util/persistent/HeapCorruptedError.java | 13 + .../java/lib/util/persistent/ObjectCache.java | 29 ++- .../lib/util/persistent/ObjectDirectory.java | 1 + .../java/lib/util/persistent/Persistent.java | 4 - .../lib/util/persistent/PersistentArray.java | 3 - .../persistent/PersistentAtomicReference.java | 1 - .../util/persistent/PersistentBoolean.java | 7 +- .../persistent/PersistentBooleanArray.java | 6 +- .../lib/util/persistent/PersistentByte.java | 7 +- .../util/persistent/PersistentByteArray.java | 6 +- .../util/persistent/PersistentCharArray.java | 6 +- .../util/persistent/PersistentCharacter.java | 7 +- .../lib/util/persistent/PersistentDouble.java | 7 +- .../persistent/PersistentDoubleArray.java | 6 +- .../lib/util/persistent/PersistentFloat.java | 7 +- .../util/persistent/PersistentFloatArray.java | 6 +- .../util/persistent/PersistentHashMap.java | 12 +- .../PersistentImmutableBooleanArray.java | 6 +- .../PersistentImmutableByteArray.java | 6 +- .../PersistentImmutableCharArray.java | 6 +- .../PersistentImmutableDoubleArray.java | 6 +- .../PersistentImmutableFloatArray.java | 6 +- .../PersistentImmutableIntArray.java | 6 +- .../PersistentImmutableLongArray.java | 6 +- .../PersistentImmutableShortArray.java | 6 +- .../persistent/PersistentImmutableTuple1.java | 3 + .../PersistentImmutableTuple10.java | 3 + .../PersistentImmutableTuple11.java | 3 + .../PersistentImmutableTuple12.java | 3 + .../PersistentImmutableTuple13.java | 3 + .../PersistentImmutableTuple14.java | 3 + .../PersistentImmutableTuple15.java | 3 + .../PersistentImmutableTuple16.java | 3 + .../PersistentImmutableTuple17.java | 3 + .../PersistentImmutableTuple18.java | 3 + .../PersistentImmutableTuple19.java | 3 + .../persistent/PersistentImmutableTuple2.java | 3 + .../PersistentImmutableTuple20.java | 3 + .../PersistentImmutableTuple21.java | 3 + .../PersistentImmutableTuple22.java | 3 + .../persistent/PersistentImmutableTuple3.java | 3 + .../persistent/PersistentImmutableTuple4.java | 3 + .../persistent/PersistentImmutableTuple5.java | 3 + .../persistent/PersistentImmutableTuple6.java | 3 + .../persistent/PersistentImmutableTuple7.java | 3 + .../persistent/PersistentImmutableTuple8.java | 3 + .../persistent/PersistentImmutableTuple9.java | 3 + .../util/persistent/PersistentIntArray.java | 6 +- .../util/persistent/PersistentInteger.java | 7 +- .../util/persistent/PersistentLinkedList.java | 1 - .../persistent/PersistentLinkedQueue.java | 11 +- .../lib/util/persistent/PersistentLong.java | 7 +- .../util/persistent/PersistentLongArray.java | 6 +- .../lib/util/persistent/PersistentObject.java | 116 +++++---- .../lib/util/persistent/PersistentShort.java | 7 +- .../util/persistent/PersistentShortArray.java | 6 +- .../persistent/PersistentSkipListMap.java | 236 ++++++++++++------ .../lib/util/persistent/PersistentTuple1.java | 10 +- .../util/persistent/PersistentTuple10.java | 10 +- .../util/persistent/PersistentTuple11.java | 10 +- .../util/persistent/PersistentTuple12.java | 10 +- .../util/persistent/PersistentTuple13.java | 10 +- .../util/persistent/PersistentTuple14.java | 10 +- .../util/persistent/PersistentTuple15.java | 10 +- .../util/persistent/PersistentTuple16.java | 10 +- .../util/persistent/PersistentTuple17.java | 10 +- .../util/persistent/PersistentTuple18.java | 10 +- .../util/persistent/PersistentTuple19.java | 10 +- .../lib/util/persistent/PersistentTuple2.java | 10 +- .../util/persistent/PersistentTuple20.java | 10 +- .../util/persistent/PersistentTuple21.java | 10 +- .../util/persistent/PersistentTuple22.java | 10 +- .../lib/util/persistent/PersistentTuple3.java | 10 +- .../lib/util/persistent/PersistentTuple4.java | 10 +- .../lib/util/persistent/PersistentTuple5.java | 10 +- .../lib/util/persistent/PersistentTuple6.java | 10 +- .../lib/util/persistent/PersistentTuple7.java | 10 +- .../lib/util/persistent/PersistentTuple8.java | 10 +- .../lib/util/persistent/PersistentTuple9.java | 10 +- .../lib/util/persistent/PersistentValue.java | 1 + .../lib/util/persistent/PhantomQueue.java | 1 + .../java/lib/util/persistent/RawString.java | 7 +- src/main/java/lib/util/persistent/Stats.java | 1 - .../java/lib/util/persistent/Transaction.java | 31 ++- .../lib/util/persistent/types/ArrayType.java | 8 +- .../java/lib/util/persistent/types/Types.java | 49 ++-- .../lib/util/persistent/types/ValueType.java | 5 + src/main/java/lib/xpersistent/XHeap.java | 1 + .../java/lib/xpersistent/XTransaction.java | 50 ++-- src/test/java/tests/TestCases.java | 4 - 276 files changed, 1323 insertions(+), 951 deletions(-) create mode 100644 src/main/java/lib/util/persistent/HeapCorruptedError.java diff --git a/.gitignore b/.gitignore index 813198f..bb40794 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +CMakeLists.txt +/cmake-build-debug /target *.class /XMemory/target @@ -12,3 +14,7 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* +.idea +*.iml + + diff --git a/LLPL/src/test/java/lib/llpl/FlushableMemoryRegionTest.java b/LLPL/src/test/java/lib/llpl/FlushableMemoryRegionTest.java index b7d5c46..93a7a74 100644 --- a/LLPL/src/test/java/lib/llpl/FlushableMemoryRegionTest.java +++ b/LLPL/src/test/java/lib/llpl/FlushableMemoryRegionTest.java @@ -17,7 +17,8 @@ * version 2 along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. - */ + *//* + package lib.llpl; @@ -74,3 +75,4 @@ public static void main(String[] args) { System.out.println("=================================All FlushableMemoryRegion tests passed!================================="); } } +*/ diff --git a/LLPL/src/test/java/lib/llpl/RawMemoryRegionTest.java b/LLPL/src/test/java/lib/llpl/RawMemoryRegionTest.java index 3a40716..baeafe8 100644 --- a/LLPL/src/test/java/lib/llpl/RawMemoryRegionTest.java +++ b/LLPL/src/test/java/lib/llpl/RawMemoryRegionTest.java @@ -17,7 +17,8 @@ * version 2 along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. - */ + *//* + package lib.llpl; @@ -55,3 +56,4 @@ public static void main(String[] args) { System.out.println("=================================All RawMemoryRegion tests passed!================================="); } } +*/ diff --git a/LLPL/src/test/java/lib/llpl/TransactionalMemoryRegionTest.java b/LLPL/src/test/java/lib/llpl/TransactionalMemoryRegionTest.java index 8c6d36c..b3343ec 100644 --- a/LLPL/src/test/java/lib/llpl/TransactionalMemoryRegionTest.java +++ b/LLPL/src/test/java/lib/llpl/TransactionalMemoryRegionTest.java @@ -1,57 +1,57 @@ -/* Copyright (C) 2017 Intel Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 only, as published by the Free Software Foundation. - * This file has been designated as subject to the "Classpath" - * exception as provided in the LICENSE file that accompanied - * this code. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License version 2 for more details (a copy - * is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -package lib.llpl; - -class TransactionalMemoryRegionTest { - public static void main(String[] args) { - Heap h = Heap.getHeap("/mnt/mem/persistent_pool"); - TransactionalMemoryRegion reg = h.allocateTransactionalMemoryRegion(16); - - reg.putByte(0, (byte)5); - assert(reg.getByte(0) == (byte)5); - - reg.putShort(1, (short)5); - assert(reg.getShort(1) == (short)5); - assert(reg.getByte(0) == (byte)5); - assert(reg.getShort(0) == (short)1285); - - reg.putInt(2, 327686); - assert(reg.getInt(2) == 327686); - assert(reg.getShort(1) == (short)1541); - assert(reg.getInt(1) == 83887621); - assert(reg.getInt(0) == 394501); - - reg.putLong(4, 123456789101112L); - assert(reg.getLong(4) == 123456789101112L); - assert(reg.getLong(3) == 31604938009884672L); - assert(reg.getInt(3) == 255473664); - assert(reg.getShort(3) == (short)14336); - assert(reg.getByte(3) == (byte)0); - - assert(reg.getLong(4) == 123456789101112L); - assert(reg.getLong(3) == 31604938009884672L); - assert(reg.getInt(3) == 255473664); - assert(reg.getShort(3) == (short)14336); - assert(reg.getByte(3) == (byte)0); - System.out.println("=================================All TransactionalMemoryRegion tests passed!================================="); - } -} +///* Copyright (C) 2017 Intel Corporation +// * +// * This program is free software; you can redistribute it and/or +// * modify it under the terms of the GNU General Public License +// * version 2 only, as published by the Free Software Foundation. +// * This file has been designated as subject to the "Classpath" +// * exception as provided in the LICENSE file that accompanied +// * this code. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License version 2 for more details (a copy +// * is included in the LICENSE file that accompanied this code). +// * +// * You should have received a copy of the GNU General Public License +// * version 2 along with this program; if not, write to the Free +// * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +// * Boston, MA 02110-1301, USA. +// */ +// +//package lib.llpl; +// +//class TransactionalMemoryRegionTest { +// public static void main(String[] args) { +// Heap h = Heap.getHeap("/mnt/mem/persistent_pool"); +// TransactionalMemoryRegion reg = h.allocateTransactionalMemoryRegion(16); +// +// reg.putByte(0, (byte)5); +// assert(reg.getByte(0) == (byte)5); +// +// reg.putShort(1, (short)5); +// assert(reg.getShort(1) == (short)5); +// assert(reg.getByte(0) == (byte)5); +// assert(reg.getShort(0) == (short)1285); +// +// reg.putInt(2, 327686); +// assert(reg.getInt(2) == 327686); +// assert(reg.getShort(1) == (short)1541); +// assert(reg.getInt(1) == 83887621); +// assert(reg.getInt(0) == 394501); +// +// reg.putLong(4, 123456789101112L); +// assert(reg.getLong(4) == 123456789101112L); +// assert(reg.getLong(3) == 31604938009884672L); +// assert(reg.getInt(3) == 255473664); +// assert(reg.getShort(3) == (short)14336); +// assert(reg.getByte(3) == (byte)0); +// +// assert(reg.getLong(4) == 123456789101112L); +// assert(reg.getLong(3) == 31604938009884672L); +// assert(reg.getInt(3) == 255473664); +// assert(reg.getShort(3) == (short)14336); +// assert(reg.getByte(3) == (byte)0); +// System.out.println("=================================All TransactionalMemoryRegion tests passed!================================="); +// } +//} diff --git a/doc/allclasses-frame.html b/doc/allclasses-frame.html index 95077a4..a26a19d 100644 --- a/doc/allclasses-frame.html +++ b/doc/allclasses-frame.html @@ -1,10 +1,10 @@ - + - + All Classes - + diff --git a/doc/allclasses-noframe.html b/doc/allclasses-noframe.html index c451277..3ff8980 100644 --- a/doc/allclasses-noframe.html +++ b/doc/allclasses-noframe.html @@ -1,10 +1,10 @@ - + - + All Classes - + diff --git a/doc/constant-values.html b/doc/constant-values.html index 51b601d..e1ab891 100644 --- a/doc/constant-values.html +++ b/doc/constant-values.html @@ -1,10 +1,10 @@ - + - + Constant Field Values - + diff --git a/doc/deprecated-list.html b/doc/deprecated-list.html index 146f6b9..6c401bf 100644 --- a/doc/deprecated-list.html +++ b/doc/deprecated-list.html @@ -1,10 +1,10 @@ - + - + Deprecated List - + diff --git a/doc/help-doc.html b/doc/help-doc.html index 6f9c67f..2e8a2a5 100644 --- a/doc/help-doc.html +++ b/doc/help-doc.html @@ -1,10 +1,10 @@ - + - + API Help - + diff --git a/doc/index-all.html b/doc/index-all.html index e51e5af..6f89138 100644 --- a/doc/index-all.html +++ b/doc/index-all.html @@ -1,10 +1,10 @@ - + - + Index - + diff --git a/doc/index.html b/doc/index.html index 7821392..7ab26e2 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1,8 +1,8 @@ - + - + Generated Documentation (Untitled) diff --git a/doc/lib/util/persistent/CycleCollector.html b/doc/lib/util/persistent/CycleCollector.html index a36502f..8ee7278 100644 --- a/doc/lib/util/persistent/CycleCollector.html +++ b/doc/lib/util/persistent/CycleCollector.html @@ -1,10 +1,10 @@ - + - + CycleCollector - + diff --git a/doc/lib/util/persistent/Header.html b/doc/lib/util/persistent/Header.html index 564d5a4..fe83a29 100644 --- a/doc/lib/util/persistent/Header.html +++ b/doc/lib/util/persistent/Header.html @@ -1,10 +1,10 @@ - + - + Header - + diff --git a/doc/lib/util/persistent/Long256.html b/doc/lib/util/persistent/Long256.html index f9a84ae..0dc31b2 100644 --- a/doc/lib/util/persistent/Long256.html +++ b/doc/lib/util/persistent/Long256.html @@ -1,10 +1,10 @@ - + - + Long256 - + diff --git a/doc/lib/util/persistent/MemoryRegion.html b/doc/lib/util/persistent/MemoryRegion.html index c1ae545..88db4a6 100644 --- a/doc/lib/util/persistent/MemoryRegion.html +++ b/doc/lib/util/persistent/MemoryRegion.html @@ -1,10 +1,10 @@ - + - + MemoryRegion - + diff --git a/doc/lib/util/persistent/ObjectCache.PRef.html b/doc/lib/util/persistent/ObjectCache.PRef.html index df5d826..dfaeddf 100644 --- a/doc/lib/util/persistent/ObjectCache.PRef.html +++ b/doc/lib/util/persistent/ObjectCache.PRef.html @@ -1,10 +1,10 @@ - + - + ObjectCache.PRef - + diff --git a/doc/lib/util/persistent/ObjectCache.Ref.html b/doc/lib/util/persistent/ObjectCache.Ref.html index 3a95c61..683e35f 100644 --- a/doc/lib/util/persistent/ObjectCache.Ref.html +++ b/doc/lib/util/persistent/ObjectCache.Ref.html @@ -1,10 +1,10 @@ - + - + ObjectCache.Ref - + diff --git a/doc/lib/util/persistent/ObjectCache.html b/doc/lib/util/persistent/ObjectCache.html index 758579e..751daf5 100644 --- a/doc/lib/util/persistent/ObjectCache.html +++ b/doc/lib/util/persistent/ObjectCache.html @@ -1,10 +1,10 @@ - + - + ObjectCache - + diff --git a/doc/lib/util/persistent/ObjectDirectory.html b/doc/lib/util/persistent/ObjectDirectory.html index 773a2a8..36cadb3 100644 --- a/doc/lib/util/persistent/ObjectDirectory.html +++ b/doc/lib/util/persistent/ObjectDirectory.html @@ -1,10 +1,10 @@ - + - + ObjectDirectory - + diff --git a/doc/lib/util/persistent/ObjectPointer.html b/doc/lib/util/persistent/ObjectPointer.html index d8fd267..2ed03cf 100644 --- a/doc/lib/util/persistent/ObjectPointer.html +++ b/doc/lib/util/persistent/ObjectPointer.html @@ -1,10 +1,10 @@ - + - + ObjectPointer - + diff --git a/doc/lib/util/persistent/PersistenceException.html b/doc/lib/util/persistent/PersistenceException.html index b835dae..bfce0f2 100644 --- a/doc/lib/util/persistent/PersistenceException.html +++ b/doc/lib/util/persistent/PersistenceException.html @@ -1,10 +1,10 @@ - + - + PersistenceException - + diff --git a/doc/lib/util/persistent/Persistent.html b/doc/lib/util/persistent/Persistent.html index 9463321..88e98ed 100644 --- a/doc/lib/util/persistent/Persistent.html +++ b/doc/lib/util/persistent/Persistent.html @@ -1,10 +1,10 @@ - + - + Persistent - + diff --git a/doc/lib/util/persistent/PersistentArray.html b/doc/lib/util/persistent/PersistentArray.html index 7b4b0a4..3334f8d 100644 --- a/doc/lib/util/persistent/PersistentArray.html +++ b/doc/lib/util/persistent/PersistentArray.html @@ -1,10 +1,10 @@ - + - + PersistentArray - + diff --git a/doc/lib/util/persistent/PersistentArrayList.Statics.html b/doc/lib/util/persistent/PersistentArrayList.Statics.html index f0aa62b..4a63301 100644 --- a/doc/lib/util/persistent/PersistentArrayList.Statics.html +++ b/doc/lib/util/persistent/PersistentArrayList.Statics.html @@ -1,10 +1,10 @@ - + - + PersistentArrayList.Statics - + diff --git a/doc/lib/util/persistent/PersistentArrayList.html b/doc/lib/util/persistent/PersistentArrayList.html index 201393b..c7db463 100644 --- a/doc/lib/util/persistent/PersistentArrayList.html +++ b/doc/lib/util/persistent/PersistentArrayList.html @@ -1,10 +1,10 @@ - + - + PersistentArrayList - + diff --git a/doc/lib/util/persistent/PersistentArrays.html b/doc/lib/util/persistent/PersistentArrays.html index 3399967..ea2301a 100644 --- a/doc/lib/util/persistent/PersistentArrays.html +++ b/doc/lib/util/persistent/PersistentArrays.html @@ -1,10 +1,10 @@ - + - + PersistentArrays - + diff --git a/doc/lib/util/persistent/PersistentAtomicReference.html b/doc/lib/util/persistent/PersistentAtomicReference.html index 8083c84..2b2e1cb 100644 --- a/doc/lib/util/persistent/PersistentAtomicReference.html +++ b/doc/lib/util/persistent/PersistentAtomicReference.html @@ -1,10 +1,10 @@ - + - + PersistentAtomicReference - + diff --git a/doc/lib/util/persistent/PersistentBoolean.html b/doc/lib/util/persistent/PersistentBoolean.html index d9bcb65..15e203c 100644 --- a/doc/lib/util/persistent/PersistentBoolean.html +++ b/doc/lib/util/persistent/PersistentBoolean.html @@ -1,10 +1,10 @@ - + - + PersistentBoolean - + diff --git a/doc/lib/util/persistent/PersistentBooleanArray.html b/doc/lib/util/persistent/PersistentBooleanArray.html index 58dc5d3..97ff3eb 100644 --- a/doc/lib/util/persistent/PersistentBooleanArray.html +++ b/doc/lib/util/persistent/PersistentBooleanArray.html @@ -1,10 +1,10 @@ - + - + PersistentBooleanArray - + diff --git a/doc/lib/util/persistent/PersistentByte.html b/doc/lib/util/persistent/PersistentByte.html index c5ca5c9..b822ff7 100644 --- a/doc/lib/util/persistent/PersistentByte.html +++ b/doc/lib/util/persistent/PersistentByte.html @@ -1,10 +1,10 @@ - + - + PersistentByte - + diff --git a/doc/lib/util/persistent/PersistentByteArray.html b/doc/lib/util/persistent/PersistentByteArray.html index fda0f23..c052b9d 100644 --- a/doc/lib/util/persistent/PersistentByteArray.html +++ b/doc/lib/util/persistent/PersistentByteArray.html @@ -1,10 +1,10 @@ - + - + PersistentByteArray - + diff --git a/doc/lib/util/persistent/PersistentCharArray.html b/doc/lib/util/persistent/PersistentCharArray.html index 617dd32..cfdaaff 100644 --- a/doc/lib/util/persistent/PersistentCharArray.html +++ b/doc/lib/util/persistent/PersistentCharArray.html @@ -1,10 +1,10 @@ - + - + PersistentCharArray - + diff --git a/doc/lib/util/persistent/PersistentCharacter.html b/doc/lib/util/persistent/PersistentCharacter.html index 8d8d2d0..c4ce4d4 100644 --- a/doc/lib/util/persistent/PersistentCharacter.html +++ b/doc/lib/util/persistent/PersistentCharacter.html @@ -1,10 +1,10 @@ - + - + PersistentCharacter - + diff --git a/doc/lib/util/persistent/PersistentDouble.html b/doc/lib/util/persistent/PersistentDouble.html index 210c677..cff9218 100644 --- a/doc/lib/util/persistent/PersistentDouble.html +++ b/doc/lib/util/persistent/PersistentDouble.html @@ -1,10 +1,10 @@ - + - + PersistentDouble - + diff --git a/doc/lib/util/persistent/PersistentDoubleArray.html b/doc/lib/util/persistent/PersistentDoubleArray.html index 8b62317..e508a13 100644 --- a/doc/lib/util/persistent/PersistentDoubleArray.html +++ b/doc/lib/util/persistent/PersistentDoubleArray.html @@ -1,10 +1,10 @@ - + - + PersistentDoubleArray - + diff --git a/doc/lib/util/persistent/PersistentFloat.html b/doc/lib/util/persistent/PersistentFloat.html index e79c63a..0450f49 100644 --- a/doc/lib/util/persistent/PersistentFloat.html +++ b/doc/lib/util/persistent/PersistentFloat.html @@ -1,10 +1,10 @@ - + - + PersistentFloat - + diff --git a/doc/lib/util/persistent/PersistentFloatArray.html b/doc/lib/util/persistent/PersistentFloatArray.html index 026f49b..06cc5fb 100644 --- a/doc/lib/util/persistent/PersistentFloatArray.html +++ b/doc/lib/util/persistent/PersistentFloatArray.html @@ -1,10 +1,10 @@ - + - + PersistentFloatArray - + diff --git a/doc/lib/util/persistent/PersistentHashMap.Node.html b/doc/lib/util/persistent/PersistentHashMap.Node.html index 17bd1af..69daf5e 100644 --- a/doc/lib/util/persistent/PersistentHashMap.Node.html +++ b/doc/lib/util/persistent/PersistentHashMap.Node.html @@ -1,10 +1,10 @@ - + - + PersistentHashMap.Node - + diff --git a/doc/lib/util/persistent/PersistentHashMap.html b/doc/lib/util/persistent/PersistentHashMap.html index cae6e96..1ca4ae3 100644 --- a/doc/lib/util/persistent/PersistentHashMap.html +++ b/doc/lib/util/persistent/PersistentHashMap.html @@ -1,10 +1,10 @@ - + - + PersistentHashMap - + diff --git a/doc/lib/util/persistent/PersistentHeap.html b/doc/lib/util/persistent/PersistentHeap.html index b542182..ca9b957 100644 --- a/doc/lib/util/persistent/PersistentHeap.html +++ b/doc/lib/util/persistent/PersistentHeap.html @@ -1,10 +1,10 @@ - + - + PersistentHeap - + diff --git a/doc/lib/util/persistent/PersistentImmutableArray.html b/doc/lib/util/persistent/PersistentImmutableArray.html index 3a6a3d8..6751fd2 100644 --- a/doc/lib/util/persistent/PersistentImmutableArray.html +++ b/doc/lib/util/persistent/PersistentImmutableArray.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableArray - + diff --git a/doc/lib/util/persistent/PersistentImmutableBooleanArray.html b/doc/lib/util/persistent/PersistentImmutableBooleanArray.html index 9e0bc32..017963b 100644 --- a/doc/lib/util/persistent/PersistentImmutableBooleanArray.html +++ b/doc/lib/util/persistent/PersistentImmutableBooleanArray.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableBooleanArray - + diff --git a/doc/lib/util/persistent/PersistentImmutableByteArray.html b/doc/lib/util/persistent/PersistentImmutableByteArray.html index 0aab631..001207e 100644 --- a/doc/lib/util/persistent/PersistentImmutableByteArray.html +++ b/doc/lib/util/persistent/PersistentImmutableByteArray.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableByteArray - + diff --git a/doc/lib/util/persistent/PersistentImmutableCharArray.html b/doc/lib/util/persistent/PersistentImmutableCharArray.html index bed7dd2..2a0679e 100644 --- a/doc/lib/util/persistent/PersistentImmutableCharArray.html +++ b/doc/lib/util/persistent/PersistentImmutableCharArray.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableCharArray - + diff --git a/doc/lib/util/persistent/PersistentImmutableDoubleArray.html b/doc/lib/util/persistent/PersistentImmutableDoubleArray.html index a0ebae3..1c72ca2 100644 --- a/doc/lib/util/persistent/PersistentImmutableDoubleArray.html +++ b/doc/lib/util/persistent/PersistentImmutableDoubleArray.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableDoubleArray - + diff --git a/doc/lib/util/persistent/PersistentImmutableFloatArray.html b/doc/lib/util/persistent/PersistentImmutableFloatArray.html index a7c2efa..4107e35 100644 --- a/doc/lib/util/persistent/PersistentImmutableFloatArray.html +++ b/doc/lib/util/persistent/PersistentImmutableFloatArray.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableFloatArray - + diff --git a/doc/lib/util/persistent/PersistentImmutableIntArray.html b/doc/lib/util/persistent/PersistentImmutableIntArray.html index e876fcb..95ea6d5 100644 --- a/doc/lib/util/persistent/PersistentImmutableIntArray.html +++ b/doc/lib/util/persistent/PersistentImmutableIntArray.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableIntArray - + diff --git a/doc/lib/util/persistent/PersistentImmutableLongArray.html b/doc/lib/util/persistent/PersistentImmutableLongArray.html index 9b176a3..1526265 100644 --- a/doc/lib/util/persistent/PersistentImmutableLongArray.html +++ b/doc/lib/util/persistent/PersistentImmutableLongArray.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableLongArray - + diff --git a/doc/lib/util/persistent/PersistentImmutableShortArray.html b/doc/lib/util/persistent/PersistentImmutableShortArray.html index a076b15..856b772 100644 --- a/doc/lib/util/persistent/PersistentImmutableShortArray.html +++ b/doc/lib/util/persistent/PersistentImmutableShortArray.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableShortArray - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple1.html b/doc/lib/util/persistent/PersistentImmutableTuple1.html index 487fb87..e00dac1 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple1.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple1.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple1 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple10.html b/doc/lib/util/persistent/PersistentImmutableTuple10.html index 7a80205..cc600a7 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple10.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple10.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple10 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple11.html b/doc/lib/util/persistent/PersistentImmutableTuple11.html index d555899..6e475d1 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple11.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple11.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple11 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple12.html b/doc/lib/util/persistent/PersistentImmutableTuple12.html index 581640e..587208d 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple12.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple12.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple12 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple13.html b/doc/lib/util/persistent/PersistentImmutableTuple13.html index b5aefcf..75a054c 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple13.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple13.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple13 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple14.html b/doc/lib/util/persistent/PersistentImmutableTuple14.html index 4263487..a09821e 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple14.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple14.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple14 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple15.html b/doc/lib/util/persistent/PersistentImmutableTuple15.html index 755e7c9..b3a03e0 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple15.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple15.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple15 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple16.html b/doc/lib/util/persistent/PersistentImmutableTuple16.html index 7806267..08c19ec 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple16.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple16.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple16 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple17.html b/doc/lib/util/persistent/PersistentImmutableTuple17.html index ba0c000..391f590 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple17.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple17.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple17 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple18.html b/doc/lib/util/persistent/PersistentImmutableTuple18.html index 1912dbc..ab8d83c 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple18.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple18.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple18 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple19.html b/doc/lib/util/persistent/PersistentImmutableTuple19.html index cd4c91e..b0aba44 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple19.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple19.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple19 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple2.html b/doc/lib/util/persistent/PersistentImmutableTuple2.html index 0499535..3df8e5f 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple2.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple2.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple2 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple20.html b/doc/lib/util/persistent/PersistentImmutableTuple20.html index 1b0ed91..dfa213f 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple20.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple20.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple20 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple21.html b/doc/lib/util/persistent/PersistentImmutableTuple21.html index 90a073c..8c8d837 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple21.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple21.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple21 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple22.html b/doc/lib/util/persistent/PersistentImmutableTuple22.html index 75f78ed..c9ba9d8 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple22.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple22.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple22 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple3.html b/doc/lib/util/persistent/PersistentImmutableTuple3.html index 608d25e..aff6584 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple3.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple3.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple3 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple4.html b/doc/lib/util/persistent/PersistentImmutableTuple4.html index f87613b..2f8b026 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple4.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple4.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple4 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple5.html b/doc/lib/util/persistent/PersistentImmutableTuple5.html index 007281b..12586c1 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple5.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple5.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple5 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple6.html b/doc/lib/util/persistent/PersistentImmutableTuple6.html index ae3e222..2f6ea76 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple6.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple6.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple6 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple7.html b/doc/lib/util/persistent/PersistentImmutableTuple7.html index 887f861..6f95f16 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple7.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple7.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple7 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple8.html b/doc/lib/util/persistent/PersistentImmutableTuple8.html index 8de9ed1..b9f1d76 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple8.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple8.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple8 - + diff --git a/doc/lib/util/persistent/PersistentImmutableTuple9.html b/doc/lib/util/persistent/PersistentImmutableTuple9.html index e251068..aa9bd64 100644 --- a/doc/lib/util/persistent/PersistentImmutableTuple9.html +++ b/doc/lib/util/persistent/PersistentImmutableTuple9.html @@ -1,10 +1,10 @@ - + - + PersistentImmutableTuple9 - + diff --git a/doc/lib/util/persistent/PersistentIntArray.html b/doc/lib/util/persistent/PersistentIntArray.html index 34750fa..2d750d6 100644 --- a/doc/lib/util/persistent/PersistentIntArray.html +++ b/doc/lib/util/persistent/PersistentIntArray.html @@ -1,10 +1,10 @@ - + - + PersistentIntArray - + diff --git a/doc/lib/util/persistent/PersistentInteger.html b/doc/lib/util/persistent/PersistentInteger.html index d695cc1..dcb4a5c 100644 --- a/doc/lib/util/persistent/PersistentInteger.html +++ b/doc/lib/util/persistent/PersistentInteger.html @@ -1,10 +1,10 @@ - + - + PersistentInteger - + diff --git a/doc/lib/util/persistent/PersistentLinkedList.PersistentEntry.html b/doc/lib/util/persistent/PersistentLinkedList.PersistentEntry.html index 5ccb247..ae9b43a 100644 --- a/doc/lib/util/persistent/PersistentLinkedList.PersistentEntry.html +++ b/doc/lib/util/persistent/PersistentLinkedList.PersistentEntry.html @@ -1,10 +1,10 @@ - + - + PersistentLinkedList.PersistentEntry - + diff --git a/doc/lib/util/persistent/PersistentLinkedList.html b/doc/lib/util/persistent/PersistentLinkedList.html index 1b8daed..fa9c43b 100644 --- a/doc/lib/util/persistent/PersistentLinkedList.html +++ b/doc/lib/util/persistent/PersistentLinkedList.html @@ -1,10 +1,10 @@ - + - + PersistentLinkedList - + diff --git a/doc/lib/util/persistent/PersistentLinkedQueue.PersistentNode.html b/doc/lib/util/persistent/PersistentLinkedQueue.PersistentNode.html index 9b4774d..0e65750 100644 --- a/doc/lib/util/persistent/PersistentLinkedQueue.PersistentNode.html +++ b/doc/lib/util/persistent/PersistentLinkedQueue.PersistentNode.html @@ -1,10 +1,10 @@ - + - + PersistentLinkedQueue.PersistentNode - + diff --git a/doc/lib/util/persistent/PersistentLinkedQueue.html b/doc/lib/util/persistent/PersistentLinkedQueue.html index 966d37a..89666c9 100644 --- a/doc/lib/util/persistent/PersistentLinkedQueue.html +++ b/doc/lib/util/persistent/PersistentLinkedQueue.html @@ -1,10 +1,10 @@ - + - + PersistentLinkedQueue - + diff --git a/doc/lib/util/persistent/PersistentLong.html b/doc/lib/util/persistent/PersistentLong.html index e809d37..0020bcd 100644 --- a/doc/lib/util/persistent/PersistentLong.html +++ b/doc/lib/util/persistent/PersistentLong.html @@ -1,10 +1,10 @@ - + - + PersistentLong - + diff --git a/doc/lib/util/persistent/PersistentLongArray.html b/doc/lib/util/persistent/PersistentLongArray.html index 7ad17dd..35de540 100644 --- a/doc/lib/util/persistent/PersistentLongArray.html +++ b/doc/lib/util/persistent/PersistentLongArray.html @@ -1,10 +1,10 @@ - + - + PersistentLongArray - + diff --git a/doc/lib/util/persistent/PersistentObject.html b/doc/lib/util/persistent/PersistentObject.html index 6d66178..2b8b35b 100644 --- a/doc/lib/util/persistent/PersistentObject.html +++ b/doc/lib/util/persistent/PersistentObject.html @@ -1,10 +1,10 @@ - + - + PersistentObject - + diff --git a/doc/lib/util/persistent/PersistentShort.html b/doc/lib/util/persistent/PersistentShort.html index 34ec4d7..dc262b0 100644 --- a/doc/lib/util/persistent/PersistentShort.html +++ b/doc/lib/util/persistent/PersistentShort.html @@ -1,10 +1,10 @@ - + - + PersistentShort - + diff --git a/doc/lib/util/persistent/PersistentShortArray.html b/doc/lib/util/persistent/PersistentShortArray.html index 3019bfc..bd178f7 100644 --- a/doc/lib/util/persistent/PersistentShortArray.html +++ b/doc/lib/util/persistent/PersistentShortArray.html @@ -1,10 +1,10 @@ - + - + PersistentShortArray - + diff --git a/doc/lib/util/persistent/PersistentSkipListMap.HeadIndex.html b/doc/lib/util/persistent/PersistentSkipListMap.HeadIndex.html index aa0e8b0..e0ee96b 100644 --- a/doc/lib/util/persistent/PersistentSkipListMap.HeadIndex.html +++ b/doc/lib/util/persistent/PersistentSkipListMap.HeadIndex.html @@ -1,10 +1,10 @@ - + - + PersistentSkipListMap.HeadIndex - + diff --git a/doc/lib/util/persistent/PersistentSkipListMap.Index.html b/doc/lib/util/persistent/PersistentSkipListMap.Index.html index a6176b0..e6079f7 100644 --- a/doc/lib/util/persistent/PersistentSkipListMap.Index.html +++ b/doc/lib/util/persistent/PersistentSkipListMap.Index.html @@ -1,10 +1,10 @@ - + - + PersistentSkipListMap.Index - + diff --git a/doc/lib/util/persistent/PersistentSkipListMap.Node.html b/doc/lib/util/persistent/PersistentSkipListMap.Node.html index ebb49b1..e49c45e 100644 --- a/doc/lib/util/persistent/PersistentSkipListMap.Node.html +++ b/doc/lib/util/persistent/PersistentSkipListMap.Node.html @@ -1,10 +1,10 @@ - + - + PersistentSkipListMap.Node - + diff --git a/doc/lib/util/persistent/PersistentSkipListMap.Statics.html b/doc/lib/util/persistent/PersistentSkipListMap.Statics.html index 24c9543..bb92ad4 100644 --- a/doc/lib/util/persistent/PersistentSkipListMap.Statics.html +++ b/doc/lib/util/persistent/PersistentSkipListMap.Statics.html @@ -1,10 +1,10 @@ - + - + PersistentSkipListMap.Statics - + diff --git a/doc/lib/util/persistent/PersistentSkipListMap.html b/doc/lib/util/persistent/PersistentSkipListMap.html index ee84cfe..1205931 100644 --- a/doc/lib/util/persistent/PersistentSkipListMap.html +++ b/doc/lib/util/persistent/PersistentSkipListMap.html @@ -1,10 +1,10 @@ - + - + PersistentSkipListMap - + @@ -489,7 +489,7 @@

Methods inherited from class lib.util.persistent.
  • diff --git a/doc/lib/util/persistent/PersistentString.html b/doc/lib/util/persistent/PersistentString.html index d55f0de..3073cf6 100644 --- a/doc/lib/util/persistent/PersistentString.html +++ b/doc/lib/util/persistent/PersistentString.html @@ -1,10 +1,10 @@ - + - + PersistentString - + diff --git a/doc/lib/util/persistent/PersistentTuple1.html b/doc/lib/util/persistent/PersistentTuple1.html index 17fae9a..d397064 100644 --- a/doc/lib/util/persistent/PersistentTuple1.html +++ b/doc/lib/util/persistent/PersistentTuple1.html @@ -1,10 +1,10 @@ - + - + PersistentTuple1 - + diff --git a/doc/lib/util/persistent/PersistentTuple10.html b/doc/lib/util/persistent/PersistentTuple10.html index 492f7d8..2271e15 100644 --- a/doc/lib/util/persistent/PersistentTuple10.html +++ b/doc/lib/util/persistent/PersistentTuple10.html @@ -1,10 +1,10 @@ - + - + PersistentTuple10 - + diff --git a/doc/lib/util/persistent/PersistentTuple11.html b/doc/lib/util/persistent/PersistentTuple11.html index 380cea7..9557669 100644 --- a/doc/lib/util/persistent/PersistentTuple11.html +++ b/doc/lib/util/persistent/PersistentTuple11.html @@ -1,10 +1,10 @@ - + - + PersistentTuple11 - + diff --git a/doc/lib/util/persistent/PersistentTuple12.html b/doc/lib/util/persistent/PersistentTuple12.html index 27cf586..b137f36 100644 --- a/doc/lib/util/persistent/PersistentTuple12.html +++ b/doc/lib/util/persistent/PersistentTuple12.html @@ -1,10 +1,10 @@ - + - + PersistentTuple12 - + diff --git a/doc/lib/util/persistent/PersistentTuple13.html b/doc/lib/util/persistent/PersistentTuple13.html index f3bc0c6..cbade49 100644 --- a/doc/lib/util/persistent/PersistentTuple13.html +++ b/doc/lib/util/persistent/PersistentTuple13.html @@ -1,10 +1,10 @@ - + - + PersistentTuple13 - + diff --git a/doc/lib/util/persistent/PersistentTuple14.html b/doc/lib/util/persistent/PersistentTuple14.html index f26593c..3d0ffc1 100644 --- a/doc/lib/util/persistent/PersistentTuple14.html +++ b/doc/lib/util/persistent/PersistentTuple14.html @@ -1,10 +1,10 @@ - + - + PersistentTuple14 - + diff --git a/doc/lib/util/persistent/PersistentTuple15.html b/doc/lib/util/persistent/PersistentTuple15.html index 626e3af..8bac829 100644 --- a/doc/lib/util/persistent/PersistentTuple15.html +++ b/doc/lib/util/persistent/PersistentTuple15.html @@ -1,10 +1,10 @@ - + - + PersistentTuple15 - + diff --git a/doc/lib/util/persistent/PersistentTuple16.html b/doc/lib/util/persistent/PersistentTuple16.html index 6b896ba..98e99d9 100644 --- a/doc/lib/util/persistent/PersistentTuple16.html +++ b/doc/lib/util/persistent/PersistentTuple16.html @@ -1,10 +1,10 @@ - + - + PersistentTuple16 - + diff --git a/doc/lib/util/persistent/PersistentTuple17.html b/doc/lib/util/persistent/PersistentTuple17.html index 13749d4..386946b 100644 --- a/doc/lib/util/persistent/PersistentTuple17.html +++ b/doc/lib/util/persistent/PersistentTuple17.html @@ -1,10 +1,10 @@ - + - + PersistentTuple17 - + diff --git a/doc/lib/util/persistent/PersistentTuple18.html b/doc/lib/util/persistent/PersistentTuple18.html index 297e42c..0617bdc 100644 --- a/doc/lib/util/persistent/PersistentTuple18.html +++ b/doc/lib/util/persistent/PersistentTuple18.html @@ -1,10 +1,10 @@ - + - + PersistentTuple18 - + diff --git a/doc/lib/util/persistent/PersistentTuple19.html b/doc/lib/util/persistent/PersistentTuple19.html index 724eca4..af5c279 100644 --- a/doc/lib/util/persistent/PersistentTuple19.html +++ b/doc/lib/util/persistent/PersistentTuple19.html @@ -1,10 +1,10 @@ - + - + PersistentTuple19 - + diff --git a/doc/lib/util/persistent/PersistentTuple2.html b/doc/lib/util/persistent/PersistentTuple2.html index 16c48fe..76f2e75 100644 --- a/doc/lib/util/persistent/PersistentTuple2.html +++ b/doc/lib/util/persistent/PersistentTuple2.html @@ -1,10 +1,10 @@ - + - + PersistentTuple2 - + diff --git a/doc/lib/util/persistent/PersistentTuple20.html b/doc/lib/util/persistent/PersistentTuple20.html index f219ee5..144f3c4 100644 --- a/doc/lib/util/persistent/PersistentTuple20.html +++ b/doc/lib/util/persistent/PersistentTuple20.html @@ -1,10 +1,10 @@ - + - + PersistentTuple20 - + diff --git a/doc/lib/util/persistent/PersistentTuple21.html b/doc/lib/util/persistent/PersistentTuple21.html index 52fbc3e..75476ec 100644 --- a/doc/lib/util/persistent/PersistentTuple21.html +++ b/doc/lib/util/persistent/PersistentTuple21.html @@ -1,10 +1,10 @@ - + - + PersistentTuple21 - + diff --git a/doc/lib/util/persistent/PersistentTuple22.html b/doc/lib/util/persistent/PersistentTuple22.html index b371810..0b3fa3d 100644 --- a/doc/lib/util/persistent/PersistentTuple22.html +++ b/doc/lib/util/persistent/PersistentTuple22.html @@ -1,10 +1,10 @@ - + - + PersistentTuple22 - + diff --git a/doc/lib/util/persistent/PersistentTuple3.html b/doc/lib/util/persistent/PersistentTuple3.html index 5144598..085b7c4 100644 --- a/doc/lib/util/persistent/PersistentTuple3.html +++ b/doc/lib/util/persistent/PersistentTuple3.html @@ -1,10 +1,10 @@ - + - + PersistentTuple3 - + diff --git a/doc/lib/util/persistent/PersistentTuple4.html b/doc/lib/util/persistent/PersistentTuple4.html index 173695a..67b2f60 100644 --- a/doc/lib/util/persistent/PersistentTuple4.html +++ b/doc/lib/util/persistent/PersistentTuple4.html @@ -1,10 +1,10 @@ - + - + PersistentTuple4 - + diff --git a/doc/lib/util/persistent/PersistentTuple5.html b/doc/lib/util/persistent/PersistentTuple5.html index 9979f12..a0f83b8 100644 --- a/doc/lib/util/persistent/PersistentTuple5.html +++ b/doc/lib/util/persistent/PersistentTuple5.html @@ -1,10 +1,10 @@ - + - + PersistentTuple5 - + diff --git a/doc/lib/util/persistent/PersistentTuple6.html b/doc/lib/util/persistent/PersistentTuple6.html index e1483de..92e0cd9 100644 --- a/doc/lib/util/persistent/PersistentTuple6.html +++ b/doc/lib/util/persistent/PersistentTuple6.html @@ -1,10 +1,10 @@ - + - + PersistentTuple6 - + diff --git a/doc/lib/util/persistent/PersistentTuple7.html b/doc/lib/util/persistent/PersistentTuple7.html index 296b1ca..69a535d 100644 --- a/doc/lib/util/persistent/PersistentTuple7.html +++ b/doc/lib/util/persistent/PersistentTuple7.html @@ -1,10 +1,10 @@ - + - + PersistentTuple7 - + diff --git a/doc/lib/util/persistent/PersistentTuple8.html b/doc/lib/util/persistent/PersistentTuple8.html index cb1c730..630d553 100644 --- a/doc/lib/util/persistent/PersistentTuple8.html +++ b/doc/lib/util/persistent/PersistentTuple8.html @@ -1,10 +1,10 @@ - + - + PersistentTuple8 - + diff --git a/doc/lib/util/persistent/PersistentTuple9.html b/doc/lib/util/persistent/PersistentTuple9.html index eb42b6b..3d750bd 100644 --- a/doc/lib/util/persistent/PersistentTuple9.html +++ b/doc/lib/util/persistent/PersistentTuple9.html @@ -1,10 +1,10 @@ - + - + PersistentTuple9 - + diff --git a/doc/lib/util/persistent/PersistentValue.html b/doc/lib/util/persistent/PersistentValue.html index 25aa199..13daeba 100644 --- a/doc/lib/util/persistent/PersistentValue.html +++ b/doc/lib/util/persistent/PersistentValue.html @@ -1,10 +1,10 @@ - + - + PersistentValue - + diff --git a/doc/lib/util/persistent/PersistentValueArray.html b/doc/lib/util/persistent/PersistentValueArray.html index e33361e..294920d 100644 --- a/doc/lib/util/persistent/PersistentValueArray.html +++ b/doc/lib/util/persistent/PersistentValueArray.html @@ -1,10 +1,10 @@ - + - + PersistentValueArray - + diff --git a/doc/lib/util/persistent/Root.html b/doc/lib/util/persistent/Root.html index 9aa39c6..26e05a8 100644 --- a/doc/lib/util/persistent/Root.html +++ b/doc/lib/util/persistent/Root.html @@ -1,10 +1,10 @@ - + - + Root - + diff --git a/doc/lib/util/persistent/Stats.LockStats.html b/doc/lib/util/persistent/Stats.LockStats.html index 9b23d2c..e7dba0e 100644 --- a/doc/lib/util/persistent/Stats.LockStats.html +++ b/doc/lib/util/persistent/Stats.LockStats.html @@ -1,10 +1,10 @@ - + - + Stats.LockStats - + diff --git a/doc/lib/util/persistent/Stats.ObjectCacheStats.html b/doc/lib/util/persistent/Stats.ObjectCacheStats.html index 59ebc24..5284fb0 100644 --- a/doc/lib/util/persistent/Stats.ObjectCacheStats.html +++ b/doc/lib/util/persistent/Stats.ObjectCacheStats.html @@ -1,10 +1,10 @@ - + - + Stats.ObjectCacheStats - + diff --git a/doc/lib/util/persistent/Stats.TransactionStats.html b/doc/lib/util/persistent/Stats.TransactionStats.html index cbdc687..c60f3a0 100644 --- a/doc/lib/util/persistent/Stats.TransactionStats.html +++ b/doc/lib/util/persistent/Stats.TransactionStats.html @@ -1,10 +1,10 @@ - + - + Stats.TransactionStats - + diff --git a/doc/lib/util/persistent/Stats.html b/doc/lib/util/persistent/Stats.html index b81af08..25d12c5 100644 --- a/doc/lib/util/persistent/Stats.html +++ b/doc/lib/util/persistent/Stats.html @@ -1,10 +1,10 @@ - + - + Stats - + diff --git a/doc/lib/util/persistent/Trace.html b/doc/lib/util/persistent/Trace.html index 863a10e..8915e04 100644 --- a/doc/lib/util/persistent/Trace.html +++ b/doc/lib/util/persistent/Trace.html @@ -1,10 +1,10 @@ - + - + Trace - + diff --git a/doc/lib/util/persistent/Transaction.State.html b/doc/lib/util/persistent/Transaction.State.html index d58608f..39f091d 100644 --- a/doc/lib/util/persistent/Transaction.State.html +++ b/doc/lib/util/persistent/Transaction.State.html @@ -1,10 +1,10 @@ - + - + Transaction.State - + diff --git a/doc/lib/util/persistent/Transaction.Update.html b/doc/lib/util/persistent/Transaction.Update.html index 2637a63..a0a3462 100644 --- a/doc/lib/util/persistent/Transaction.Update.html +++ b/doc/lib/util/persistent/Transaction.Update.html @@ -1,10 +1,10 @@ - + - + Transaction.Update - + diff --git a/doc/lib/util/persistent/Transaction.html b/doc/lib/util/persistent/Transaction.html index 95d4e9f..fe6649b 100644 --- a/doc/lib/util/persistent/Transaction.html +++ b/doc/lib/util/persistent/Transaction.html @@ -1,10 +1,10 @@ - + - + Transaction - + diff --git a/doc/lib/util/persistent/TransactionError.html b/doc/lib/util/persistent/TransactionError.html index 5f42255..043066d 100644 --- a/doc/lib/util/persistent/TransactionError.html +++ b/doc/lib/util/persistent/TransactionError.html @@ -1,10 +1,10 @@ - + - + TransactionError - + diff --git a/doc/lib/util/persistent/TransactionException.html b/doc/lib/util/persistent/TransactionException.html index 3c7454c..2232c52 100644 --- a/doc/lib/util/persistent/TransactionException.html +++ b/doc/lib/util/persistent/TransactionException.html @@ -1,10 +1,10 @@ - + - + TransactionException - + diff --git a/doc/lib/util/persistent/TransactionRetryException.html b/doc/lib/util/persistent/TransactionRetryException.html index 87fb3a9..a20caaa 100644 --- a/doc/lib/util/persistent/TransactionRetryException.html +++ b/doc/lib/util/persistent/TransactionRetryException.html @@ -1,10 +1,10 @@ - + - + TransactionRetryException - + diff --git a/doc/lib/util/persistent/ValuePointer.html b/doc/lib/util/persistent/ValuePointer.html index f459ff8..8dc9861 100644 --- a/doc/lib/util/persistent/ValuePointer.html +++ b/doc/lib/util/persistent/ValuePointer.html @@ -1,10 +1,10 @@ - + - + ValuePointer - + diff --git a/doc/lib/util/persistent/front/PersistentClass.html b/doc/lib/util/persistent/front/PersistentClass.html index 713cd95..36f9ef8 100644 --- a/doc/lib/util/persistent/front/PersistentClass.html +++ b/doc/lib/util/persistent/front/PersistentClass.html @@ -1,10 +1,10 @@ - + - + PersistentClass - + diff --git a/doc/lib/util/persistent/front/Processor.html b/doc/lib/util/persistent/front/Processor.html index 01ea250..bd9637a 100644 --- a/doc/lib/util/persistent/front/Processor.html +++ b/doc/lib/util/persistent/front/Processor.html @@ -1,10 +1,10 @@ - + - + Processor - + diff --git a/doc/lib/util/persistent/front/package-frame.html b/doc/lib/util/persistent/front/package-frame.html index b463152..2e49fe8 100644 --- a/doc/lib/util/persistent/front/package-frame.html +++ b/doc/lib/util/persistent/front/package-frame.html @@ -1,10 +1,10 @@ - + - + lib.util.persistent.front - + diff --git a/doc/lib/util/persistent/front/package-summary.html b/doc/lib/util/persistent/front/package-summary.html index 1ea73e4..e759d81 100644 --- a/doc/lib/util/persistent/front/package-summary.html +++ b/doc/lib/util/persistent/front/package-summary.html @@ -1,10 +1,10 @@ - + - + lib.util.persistent.front - + diff --git a/doc/lib/util/persistent/front/package-tree.html b/doc/lib/util/persistent/front/package-tree.html index 0470992..409a8ba 100644 --- a/doc/lib/util/persistent/front/package-tree.html +++ b/doc/lib/util/persistent/front/package-tree.html @@ -1,10 +1,10 @@ - + - + lib.util.persistent.front Class Hierarchy - + diff --git a/doc/lib/util/persistent/package-frame.html b/doc/lib/util/persistent/package-frame.html index 16b4b19..af8cb69 100644 --- a/doc/lib/util/persistent/package-frame.html +++ b/doc/lib/util/persistent/package-frame.html @@ -1,10 +1,10 @@ - + - + lib.util.persistent - + diff --git a/doc/lib/util/persistent/package-summary.html b/doc/lib/util/persistent/package-summary.html index 790b008..8e4fc62 100644 --- a/doc/lib/util/persistent/package-summary.html +++ b/doc/lib/util/persistent/package-summary.html @@ -1,10 +1,10 @@ - + - + lib.util.persistent - + diff --git a/doc/lib/util/persistent/package-tree.html b/doc/lib/util/persistent/package-tree.html index 7698a24..0b0b97d 100644 --- a/doc/lib/util/persistent/package-tree.html +++ b/doc/lib/util/persistent/package-tree.html @@ -1,10 +1,10 @@ - + - + lib.util.persistent Class Hierarchy - + diff --git a/doc/lib/util/persistent/spi/PersistentMemoryProvider.html b/doc/lib/util/persistent/spi/PersistentMemoryProvider.html index bd420fb..f4cdac6 100644 --- a/doc/lib/util/persistent/spi/PersistentMemoryProvider.html +++ b/doc/lib/util/persistent/spi/PersistentMemoryProvider.html @@ -1,10 +1,10 @@ - + - + PersistentMemoryProvider - + diff --git a/doc/lib/util/persistent/spi/package-frame.html b/doc/lib/util/persistent/spi/package-frame.html index 1385751..0a78124 100644 --- a/doc/lib/util/persistent/spi/package-frame.html +++ b/doc/lib/util/persistent/spi/package-frame.html @@ -1,10 +1,10 @@ - + - + lib.util.persistent.spi - + diff --git a/doc/lib/util/persistent/spi/package-summary.html b/doc/lib/util/persistent/spi/package-summary.html index f2b622b..1390bb6 100644 --- a/doc/lib/util/persistent/spi/package-summary.html +++ b/doc/lib/util/persistent/spi/package-summary.html @@ -1,10 +1,10 @@ - + - + lib.util.persistent.spi - + diff --git a/doc/lib/util/persistent/spi/package-tree.html b/doc/lib/util/persistent/spi/package-tree.html index cf1a262..7ab6032 100644 --- a/doc/lib/util/persistent/spi/package-tree.html +++ b/doc/lib/util/persistent/spi/package-tree.html @@ -1,10 +1,10 @@ - + - + lib.util.persistent.spi Class Hierarchy - + diff --git a/doc/lib/util/persistent/types/ArrayType.html b/doc/lib/util/persistent/types/ArrayType.html index beabf45..efcd19f 100644 --- a/doc/lib/util/persistent/types/ArrayType.html +++ b/doc/lib/util/persistent/types/ArrayType.html @@ -1,10 +1,10 @@ - + - + ArrayType - + diff --git a/doc/lib/util/persistent/types/BooleanField.html b/doc/lib/util/persistent/types/BooleanField.html index aa7f745..fce3ec1 100644 --- a/doc/lib/util/persistent/types/BooleanField.html +++ b/doc/lib/util/persistent/types/BooleanField.html @@ -1,10 +1,10 @@ - + - + BooleanField - + diff --git a/doc/lib/util/persistent/types/ByteField.html b/doc/lib/util/persistent/types/ByteField.html index 320dbdf..54c146e 100644 --- a/doc/lib/util/persistent/types/ByteField.html +++ b/doc/lib/util/persistent/types/ByteField.html @@ -1,10 +1,10 @@ - + - + ByteField - + diff --git a/doc/lib/util/persistent/types/Carried.html b/doc/lib/util/persistent/types/Carried.html index 105b4bd..49a2c73 100644 --- a/doc/lib/util/persistent/types/Carried.html +++ b/doc/lib/util/persistent/types/Carried.html @@ -1,10 +1,10 @@ - + - + Carried - + diff --git a/doc/lib/util/persistent/types/CarriedType.html b/doc/lib/util/persistent/types/CarriedType.html index b29d4eb..70eeab1 100644 --- a/doc/lib/util/persistent/types/CarriedType.html +++ b/doc/lib/util/persistent/types/CarriedType.html @@ -1,10 +1,10 @@ - + - + CarriedType - + diff --git a/doc/lib/util/persistent/types/CharField.html b/doc/lib/util/persistent/types/CharField.html index 0391bc6..91a16fc 100644 --- a/doc/lib/util/persistent/types/CharField.html +++ b/doc/lib/util/persistent/types/CharField.html @@ -1,10 +1,10 @@ - + - + CharField - + diff --git a/doc/lib/util/persistent/types/Container.html b/doc/lib/util/persistent/types/Container.html index 621f86c..bc3695e 100644 --- a/doc/lib/util/persistent/types/Container.html +++ b/doc/lib/util/persistent/types/Container.html @@ -1,10 +1,10 @@ - + - + Container - + diff --git a/doc/lib/util/persistent/types/DoubleField.html b/doc/lib/util/persistent/types/DoubleField.html index 6b50788..142df5a 100644 --- a/doc/lib/util/persistent/types/DoubleField.html +++ b/doc/lib/util/persistent/types/DoubleField.html @@ -1,10 +1,10 @@ - + - + DoubleField - + diff --git a/doc/lib/util/persistent/types/FloatField.html b/doc/lib/util/persistent/types/FloatField.html index d7fd50a..736c001 100644 --- a/doc/lib/util/persistent/types/FloatField.html +++ b/doc/lib/util/persistent/types/FloatField.html @@ -1,10 +1,10 @@ - + - + FloatField - + diff --git a/doc/lib/util/persistent/types/Indexed.html b/doc/lib/util/persistent/types/Indexed.html index 85414e1..7352fc2 100644 --- a/doc/lib/util/persistent/types/Indexed.html +++ b/doc/lib/util/persistent/types/Indexed.html @@ -1,10 +1,10 @@ - + - + Indexed - + diff --git a/doc/lib/util/persistent/types/IntField.html b/doc/lib/util/persistent/types/IntField.html index 3489e3e..545d479 100644 --- a/doc/lib/util/persistent/types/IntField.html +++ b/doc/lib/util/persistent/types/IntField.html @@ -1,10 +1,10 @@ - + - + IntField - + diff --git a/doc/lib/util/persistent/types/LongField.html b/doc/lib/util/persistent/types/LongField.html index 2161141..ea9a5ce 100644 --- a/doc/lib/util/persistent/types/LongField.html +++ b/doc/lib/util/persistent/types/LongField.html @@ -1,10 +1,10 @@ - + - + LongField - + diff --git a/doc/lib/util/persistent/types/Named.html b/doc/lib/util/persistent/types/Named.html index 868d50e..486bde5 100644 --- a/doc/lib/util/persistent/types/Named.html +++ b/doc/lib/util/persistent/types/Named.html @@ -1,10 +1,10 @@ - + - + Named - + diff --git a/doc/lib/util/persistent/types/ObjectField.html b/doc/lib/util/persistent/types/ObjectField.html index 5669009..1354a34 100644 --- a/doc/lib/util/persistent/types/ObjectField.html +++ b/doc/lib/util/persistent/types/ObjectField.html @@ -1,10 +1,10 @@ - + - + ObjectField - + diff --git a/doc/lib/util/persistent/types/ObjectType.html b/doc/lib/util/persistent/types/ObjectType.html index 4497838..2881da4 100644 --- a/doc/lib/util/persistent/types/ObjectType.html +++ b/doc/lib/util/persistent/types/ObjectType.html @@ -1,10 +1,10 @@ - + - + ObjectType - + diff --git a/doc/lib/util/persistent/types/PersistentField.html b/doc/lib/util/persistent/types/PersistentField.html index f466709..05e9fde 100644 --- a/doc/lib/util/persistent/types/PersistentField.html +++ b/doc/lib/util/persistent/types/PersistentField.html @@ -1,10 +1,10 @@ - + - + PersistentField - + diff --git a/doc/lib/util/persistent/types/PersistentType.html b/doc/lib/util/persistent/types/PersistentType.html index 21bc63a..6e77824 100644 --- a/doc/lib/util/persistent/types/PersistentType.html +++ b/doc/lib/util/persistent/types/PersistentType.html @@ -1,10 +1,10 @@ - + - + PersistentType - + diff --git a/doc/lib/util/persistent/types/PrimitiveType.html b/doc/lib/util/persistent/types/PrimitiveType.html index 9c8c680..81dddf8 100644 --- a/doc/lib/util/persistent/types/PrimitiveType.html +++ b/doc/lib/util/persistent/types/PrimitiveType.html @@ -1,10 +1,10 @@ - + - + PrimitiveType - + diff --git a/doc/lib/util/persistent/types/ShortField.html b/doc/lib/util/persistent/types/ShortField.html index 4a49cfb..8b5f922 100644 --- a/doc/lib/util/persistent/types/ShortField.html +++ b/doc/lib/util/persistent/types/ShortField.html @@ -1,10 +1,10 @@ - + - + ShortField - + diff --git a/doc/lib/util/persistent/types/StringField.html b/doc/lib/util/persistent/types/StringField.html index 6294923..01322bf 100644 --- a/doc/lib/util/persistent/types/StringField.html +++ b/doc/lib/util/persistent/types/StringField.html @@ -1,10 +1,10 @@ - + - + StringField - + diff --git a/doc/lib/util/persistent/types/Types.html b/doc/lib/util/persistent/types/Types.html index e86ee18..c5d5d58 100644 --- a/doc/lib/util/persistent/types/Types.html +++ b/doc/lib/util/persistent/types/Types.html @@ -1,10 +1,10 @@ - + - + Types - + diff --git a/doc/lib/util/persistent/types/ValueArrayType.html b/doc/lib/util/persistent/types/ValueArrayType.html index 6c87c62..a1aded0 100644 --- a/doc/lib/util/persistent/types/ValueArrayType.html +++ b/doc/lib/util/persistent/types/ValueArrayType.html @@ -1,10 +1,10 @@ - + - + ValueArrayType - + diff --git a/doc/lib/util/persistent/types/ValueField.html b/doc/lib/util/persistent/types/ValueField.html index 676514c..f279e2d 100644 --- a/doc/lib/util/persistent/types/ValueField.html +++ b/doc/lib/util/persistent/types/ValueField.html @@ -1,10 +1,10 @@ - + - + ValueField - + diff --git a/doc/lib/util/persistent/types/ValueType.html b/doc/lib/util/persistent/types/ValueType.html index 77d4dfc..661f15e 100644 --- a/doc/lib/util/persistent/types/ValueType.html +++ b/doc/lib/util/persistent/types/ValueType.html @@ -1,10 +1,10 @@ - + - + ValueType - + diff --git a/doc/lib/util/persistent/types/package-frame.html b/doc/lib/util/persistent/types/package-frame.html index ac83abc..7c4ddeb 100644 --- a/doc/lib/util/persistent/types/package-frame.html +++ b/doc/lib/util/persistent/types/package-frame.html @@ -1,10 +1,10 @@ - + - + lib.util.persistent.types - + diff --git a/doc/lib/util/persistent/types/package-summary.html b/doc/lib/util/persistent/types/package-summary.html index 35cb150..b17f0ac 100644 --- a/doc/lib/util/persistent/types/package-summary.html +++ b/doc/lib/util/persistent/types/package-summary.html @@ -1,10 +1,10 @@ - + - + lib.util.persistent.types - + diff --git a/doc/lib/util/persistent/types/package-tree.html b/doc/lib/util/persistent/types/package-tree.html index 8d722e9..23edaaf 100644 --- a/doc/lib/util/persistent/types/package-tree.html +++ b/doc/lib/util/persistent/types/package-tree.html @@ -1,10 +1,10 @@ - + - + lib.util.persistent.types Class Hierarchy - + diff --git a/doc/lib/xpersistent/UncheckedPersistentMemoryRegion.html b/doc/lib/xpersistent/UncheckedPersistentMemoryRegion.html index 4548e0e..b0c52ce 100644 --- a/doc/lib/xpersistent/UncheckedPersistentMemoryRegion.html +++ b/doc/lib/xpersistent/UncheckedPersistentMemoryRegion.html @@ -1,10 +1,10 @@ - + - + UncheckedPersistentMemoryRegion - + diff --git a/doc/lib/xpersistent/XHeap.html b/doc/lib/xpersistent/XHeap.html index fac075f..c9410aa 100644 --- a/doc/lib/xpersistent/XHeap.html +++ b/doc/lib/xpersistent/XHeap.html @@ -1,10 +1,10 @@ - + - + XHeap - + diff --git a/doc/lib/xpersistent/XPersistent.html b/doc/lib/xpersistent/XPersistent.html index 0927912..e8eff68 100644 --- a/doc/lib/xpersistent/XPersistent.html +++ b/doc/lib/xpersistent/XPersistent.html @@ -1,10 +1,10 @@ - + - + XPersistent - + diff --git a/doc/lib/xpersistent/XPersistentMemory.html b/doc/lib/xpersistent/XPersistentMemory.html index 7ffabe1..3f58dcc 100644 --- a/doc/lib/xpersistent/XPersistentMemory.html +++ b/doc/lib/xpersistent/XPersistentMemory.html @@ -1,10 +1,10 @@ - + - + XPersistentMemory - + diff --git a/doc/lib/xpersistent/XRoot.html b/doc/lib/xpersistent/XRoot.html index 890a410..409d149 100644 --- a/doc/lib/xpersistent/XRoot.html +++ b/doc/lib/xpersistent/XRoot.html @@ -1,10 +1,10 @@ - + - + XRoot - + diff --git a/doc/lib/xpersistent/XTransaction.html b/doc/lib/xpersistent/XTransaction.html index 88d43de..8321bb1 100644 --- a/doc/lib/xpersistent/XTransaction.html +++ b/doc/lib/xpersistent/XTransaction.html @@ -1,10 +1,10 @@ - + - + XTransaction - + diff --git a/doc/lib/xpersistent/package-frame.html b/doc/lib/xpersistent/package-frame.html index 837850e..8157bc3 100644 --- a/doc/lib/xpersistent/package-frame.html +++ b/doc/lib/xpersistent/package-frame.html @@ -1,10 +1,10 @@ - + - + lib.xpersistent - + diff --git a/doc/lib/xpersistent/package-summary.html b/doc/lib/xpersistent/package-summary.html index 03115ef..8a748f9 100644 --- a/doc/lib/xpersistent/package-summary.html +++ b/doc/lib/xpersistent/package-summary.html @@ -1,10 +1,10 @@ - + - + lib.xpersistent - + diff --git a/doc/lib/xpersistent/package-tree.html b/doc/lib/xpersistent/package-tree.html index 1ee04a4..98ff2f5 100644 --- a/doc/lib/xpersistent/package-tree.html +++ b/doc/lib/xpersistent/package-tree.html @@ -1,10 +1,10 @@ - + - + lib.xpersistent Class Hierarchy - + diff --git a/doc/overview-frame.html b/doc/overview-frame.html index 58b92cb..1a48e46 100644 --- a/doc/overview-frame.html +++ b/doc/overview-frame.html @@ -1,10 +1,10 @@ - + - + Overview List - + diff --git a/doc/overview-summary.html b/doc/overview-summary.html index bd61e06..0e0d679 100644 --- a/doc/overview-summary.html +++ b/doc/overview-summary.html @@ -1,10 +1,10 @@ - + - + Overview - + diff --git a/doc/overview-tree.html b/doc/overview-tree.html index 3182245..e1d0ba6 100644 --- a/doc/overview-tree.html +++ b/doc/overview-tree.html @@ -1,10 +1,10 @@ - + - + Class Hierarchy - + diff --git a/doc/serialized-form.html b/doc/serialized-form.html index 65fddd6..5026e46 100644 --- a/doc/serialized-form.html +++ b/doc/serialized-form.html @@ -1,10 +1,10 @@ - + - + Serialized Form - + diff --git a/lib/tools/ArraysGen.java b/lib/tools/ArraysGen.java index 622a5a7..399174a 100644 --- a/lib/tools/ArraysGen.java +++ b/lib/tools/ArraysGen.java @@ -23,7 +23,6 @@ import java.nio.file.Files; import java.nio.file.Paths; -import java.util.stream.IntStream; import org.stringtemplate.v4.*; public class ArraysGen { @@ -41,7 +40,7 @@ public static void main(String[] args) throws Exception { st.add("smallcaps", fields[i].toLowerCase()); String source = st.render(); Files.write(Paths.get("./src/main/java/lib/util/persistent/"+ classPrefixes[j] + identifiers[i] + "Array.java"), source.getBytes()); - Files.write(Paths.get("./tmp/"+ classPrefixes[j] + identifiers[i] + "Array.java"), source.getBytes()); + //Files.write(Paths.get("./tmp/"+ classPrefixes[j] + identifiers[i] + "Array.java"), source.getBytes()); } } } diff --git a/lib/tools/PrimitivesGen.java b/lib/tools/PrimitivesGen.java index cdced4e..386c878 100644 --- a/lib/tools/PrimitivesGen.java +++ b/lib/tools/PrimitivesGen.java @@ -23,7 +23,6 @@ import java.nio.file.Files; import java.nio.file.Paths; -import java.util.stream.IntStream; import org.stringtemplate.v4.*; public class PrimitivesGen { diff --git a/lib/tools/code.stg b/lib/tools/code.stg index ac93dc9..8ab1b2f 100644 --- a/lib/tools/code.stg +++ b/lib/tools/code.stg @@ -46,11 +46,14 @@ package lib.util.persistent; import lib.util.persistent.types.*; import lib.util.persistent.types.ObjectType; -import lib.util.persistent.types.Types; +import lib.util.persistent.front.PersistentClass; -public final class Persistent extends PersistentObject implements Comparable\\> { +@PersistentClass +public final class Persistent extends PersistentObject + implements Comparable\\> { private static final Field = new Field(); private static final ObjectType\\> TYPE = ObjectType.fromFields(Persistent.class, ); + private static final long serialVersionUID = 1L; public Persistent( x) { super(TYPE); @@ -141,8 +144,12 @@ package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentImmutableArray extends AbstractPersistentImmutableArray { +@PersistentClass +public final class PersistentImmutableArray + extends AbstractPersistentImmutableArray { + private static final long serialVersionUID = 1L; private static final ArrayType\Array> TYPE = new ArrayType\<>(PersistentImmutableArray.class, Types.); public PersistentImmutableArray([] array) { @@ -193,8 +200,12 @@ package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentArray extends AbstractPersistentArray { +@PersistentClass +public final class PersistentArray + extends AbstractPersistentArray { + private static final long serialVersionUID = 1L; private static final ArrayType\Array> TYPE = new ArrayType\<>(PersistentArray.class, Types.); public PersistentArray(int size) { @@ -249,16 +260,18 @@ mjstuple_class(class_prefix, n, range) ::= << * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class Tuple\< extends PersistentObject};separator=", ">\> extends PersistentObject { - FIELD = new ObjectField\<>();};separator="\n"> +@PersistentClass +public class Tuple\< extends PersistentObject};separator=", ">\> + extends PersistentObject { + private static final long serialVersionUID = 1L; + FIELD = new ObjectField\<>();};separator="\n"> public static final ObjectType\<Tuple\> TYPE = ObjectType.fromFields(Tuple.class, };separator=", ">); public Tuple() { @@ -337,8 +350,11 @@ package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class Tuple\< extends PersistentObject};separator=", ">\> extends PersistentObject { + private static final long serialVersionUID = 1L; FIELD = new ObjectField\<>();};separator="\n"> public static final ObjectType\<Tuple\> TYPE = ObjectType.fromFields(Tuple.class, };separator=", ">); diff --git a/src/examples/database/Database.java b/src/examples/database/Database.java index c6da77d..c7a9857 100644 --- a/src/examples/database/Database.java +++ b/src/examples/database/Database.java @@ -38,6 +38,7 @@ public static void main(String[] args) { if (ObjectDirectory.get("keyspace", PersistentSkipListMap.class) == null) { keyspace = new PersistentSkipListMap<>(); ObjectDirectory.put("keyspace", keyspace); + System.out.println("New database"); } else { keyspace = ObjectDirectory.get("keyspace", PersistentSkipListMap.class); } diff --git a/src/main/java/lib/util/persistent/AbstractPersistentArray.java b/src/main/java/lib/util/persistent/AbstractPersistentArray.java index a6cac3f..c6ba01c 100644 --- a/src/main/java/lib/util/persistent/AbstractPersistentArray.java +++ b/src/main/java/lib/util/persistent/AbstractPersistentArray.java @@ -22,10 +22,6 @@ package lib.util.persistent; import lib.util.persistent.types.ArrayType; -import lib.util.persistent.types.Types; -import lib.util.persistent.types.PersistentType; -import lib.util.persistent.types.ObjectType; -import lib.util.persistent.spi.PersistentMemoryProvider; abstract class AbstractPersistentArray extends AbstractPersistentImmutableArray { AbstractPersistentArray(ArrayType type, int count) { @@ -44,22 +40,22 @@ abstract class AbstractPersistentArray extends AbstractPersistentImmutableArray @Override boolean getBooleanElement(int index) {return getByte(elementOffset(check(index))) == (byte)0 ? false : true;} @Override PersistentObject getObjectElement(int index) {return getObject(elementOffset(check(index)));} - void setByteElement(int index, byte value) {setByte(elementOffset(check(index)), value);} - void setShortElement(int index, short value) {setShort(elementOffset(check(index)), value);} - void setIntElement(int index, int value) {setInt(elementOffset(check(index)), value);} - void setLongElement(int index, long value) {setLong(elementOffset(check(index)), value);} - void setFloatElement(int index, float value) {setInt(elementOffset(check(index)), Float.floatToIntBits(value));} - void setDoubleElement(int index, double value) {setLong(elementOffset(check(index)), Double.doubleToLongBits(value));} - void setCharElement(int index, char value) {setInt(elementOffset(check(index)), (int)value);} - void setBooleanElement(int index, boolean value) {setByte(elementOffset(check(index)), value ? (byte)1 : (byte)0);} - void setObjectElement(int index, PersistentObject value) {setObject(elementOffset(check(index)), value);} - void setValueElement(int index, PersistentValue value) {super.setValueElement(index, value);} + final void setByteElement(int index, byte value) {setByte(elementOffset(check(index)), value);} + final void setShortElement(int index, short value) {setShort(elementOffset(check(index)), value);} + final void setIntElement(int index, int value) {setInt(elementOffset(check(index)), value);} + final void setLongElement(int index, long value) {setLong(elementOffset(check(index)), value);} + final void setFloatElement(int index, float value) {setInt(elementOffset(check(index)), Float.floatToIntBits(value));} + final void setDoubleElement(int index, double value) {setLong(elementOffset(check(index)), Double.doubleToLongBits(value));} + final void setCharElement(int index, char value) {setInt(elementOffset(check(index)), (int)value);} + final void setBooleanElement(int index, boolean value) {setByte(elementOffset(check(index)), value ? (byte)1 : (byte)0);} + final void setObjectElement(int index, PersistentObject value) {setObject(elementOffset(check(index)), value);} + final void setValueElement(int index, PersistentValue value) {super.setValueElement(index, value);} @Override public int length() { return getInt(ArrayType.LENGTH_OFFSET); } - @Override long elementOffset(int index) { + @Override protected long elementOffset(int index) { return ((ArrayType)getPointer().type()).getElementOffset(index); } } diff --git a/src/main/java/lib/util/persistent/AbstractPersistentImmutableArray.java b/src/main/java/lib/util/persistent/AbstractPersistentImmutableArray.java index 3254e44..78d0783 100644 --- a/src/main/java/lib/util/persistent/AbstractPersistentImmutableArray.java +++ b/src/main/java/lib/util/persistent/AbstractPersistentImmutableArray.java @@ -21,8 +21,6 @@ package lib.util.persistent; -import java.util.List; -import java.util.ArrayList; import lib.util.persistent.types.ArrayType; import lib.util.persistent.types.ValueType; import lib.util.persistent.types.Types; @@ -33,12 +31,14 @@ abstract class AbstractPersistentImmutableArray extends PersistentObject { protected AbstractPersistentImmutableArray(ArrayType type, int count, Object data) { + // FIXME: Compatible only with the default provider super(type, PersistentMemoryProvider.getDefaultProvider().getHeap().allocateRegion(type.getAllocationSize(count))); setInt(ArrayType.LENGTH_OFFSET, count); initializeElements(data, type.getElementType()); } protected AbstractPersistentImmutableArray(ArrayType type, int count) { + // FIXME: Compatible only with the default provider super(type, PersistentMemoryProvider.getDefaultProvider().getHeap().allocateRegion(type.getAllocationSize(count))); setInt(ArrayType.LENGTH_OFFSET, count); for (int i = 0; i < count; i++) {initializeElement(i, type.getElementType());} @@ -104,15 +104,15 @@ public int length() { return getInt(ArrayType.LENGTH_OFFSET); } - long elementOffset(int index) { + protected long elementOffset(int index) { return ((ArrayType)getPointer().type()).getElementOffset(index); } - long elementOffset(int index, long size) { + protected long elementOffset(int index, long size) { return ((ArrayType)getPointer().type()).getElementOffset(index, size); } - int check(int index) { + protected int check(int index) { if (index < 0 || index >= length()) throw new IndexOutOfBoundsException("index " + index + " out of bounds"); return index; } diff --git a/src/main/java/lib/util/persistent/CycleCollector.java b/src/main/java/lib/util/persistent/CycleCollector.java index 516dbda..8eb3fb0 100644 --- a/src/main/java/lib/util/persistent/CycleCollector.java +++ b/src/main/java/lib/util/persistent/CycleCollector.java @@ -44,6 +44,8 @@ public class CycleCollector { public static synchronized HashSet getCandidates() { return candidatesSet; } public static synchronized void collect() { + // FIXME: Compatible only with the default provider + // FIXME: circulare dependency between package XRoot and this package heap = ((XHeap)(PersistentMemoryProvider.getDefaultProvider().getHeap())); root = ((XRoot)(heap.getRoot())); markCandidates(); @@ -165,6 +167,8 @@ private static void collectWhite(Deque stack) { if (obj.getColor() != PURPLE) { obj.setColor(PURPLE); candidatesSet.add(addr); + // FIXME: Compatible only with the default provider + // FIXME: circulare dependency between package XRoot and this package ((XRoot)(PersistentMemoryProvider.getDefaultProvider().getHeap().getRoot())).addToCandidates(addr); } }); diff --git a/src/main/java/lib/util/persistent/Header.java b/src/main/java/lib/util/persistent/Header.java index 9b6f572..31aa520 100644 --- a/src/main/java/lib/util/persistent/Header.java +++ b/src/main/java/lib/util/persistent/Header.java @@ -33,7 +33,7 @@ public class Header { public static final PersistentType[] TYPES = new PersistentType[] { Types.LONG, // TYPE_NAME // TODO: should reference shared name or type - Types.INT, // VERSION + Types.LONG, // VERSION Types.INT, // REF_COUNT Types.BYTE, // REF_COLOR }; diff --git a/src/main/java/lib/util/persistent/HeapCorruptedError.java b/src/main/java/lib/util/persistent/HeapCorruptedError.java new file mode 100644 index 0000000..ff9d15a --- /dev/null +++ b/src/main/java/lib/util/persistent/HeapCorruptedError.java @@ -0,0 +1,13 @@ +package lib.util.persistent; + +public class HeapCorruptedError extends Error { + public HeapCorruptedError(String message) { + super(message); + } + public HeapCorruptedError(String message, Throwable cause) { + super(message, cause); + } + public HeapCorruptedError(Throwable cause) { + super(cause); + } +} diff --git a/src/main/java/lib/util/persistent/ObjectCache.java b/src/main/java/lib/util/persistent/ObjectCache.java index b55990f..f372ac0 100755 --- a/src/main/java/lib/util/persistent/ObjectCache.java +++ b/src/main/java/lib/util/persistent/ObjectCache.java @@ -24,7 +24,6 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.lang.ref.SoftReference; -import java.lang.ref.WeakReference; import java.lang.ref.PhantomReference; import java.lang.ref.Reference; import lib.util.persistent.spi.PersistentMemoryProvider; @@ -49,12 +48,13 @@ public class ObjectCache { cache = new ConcurrentHashMap<>(); queue = new ReferenceQueue<>(); prefs = new ConcurrentHashMap<>(); + // FIXME: Compatible only with the default provider heap = PersistentMemoryProvider.getDefaultProvider().getHeap(); collector = new Thread(() -> { try { while (true) { - PRef qref = (PRef)queue.remove(); - // trace(qref.getAddress(), "object enqueued"); + PRef qref = (PRef)queue.remove(); // blocking until one becomes available. + trace(qref.getAddress(), "object enqueued"); prefs.remove(qref.getAddress()); if (!qref.isForAdmin()) { synchronized(ObjectCache.class) { @@ -107,7 +107,7 @@ public PRef(T obj) { public PRef(T obj, boolean forAdmin) { super(obj, queue); - // trace("created PRef object for address " + obj.getPointer().addr()); + trace("created PRef object for address " + obj.getPointer().addr()); this.address = obj.getPointer().addr(); this.forAdmin = forAdmin; prefs.put(this.address, this); @@ -125,7 +125,7 @@ public static T get(long address) { @SuppressWarnings("unchecked") public static T get(long address, boolean forAdmin) { - // trace(address, "ObjectCache.get()"); + trace(address, "ObjectCache.get()"); Ref ref = getReference(address, forAdmin); return ref == null ? null :(T)ref.get(); } @@ -137,7 +137,7 @@ private static Ref getReference(long address, bo if (address == 0) return null; ref = (Ref)cache.get(address); if (ref == null || (obj = (T)ref.get()) == null) { - // trace(address, "MISS: " + (ref == null ? "simple" : "null referent")); + trace(address, "MISS: " + (ref == null ? "simple" : "null referent")); // if (ref == null) Stats.objectCache.simpleMisses++; else Stats.objectCache.referentMisses++; obj = objectForAddress(address, forAdmin); if (!forAdmin) obj.initForGC(); @@ -145,7 +145,7 @@ private static Ref getReference(long address, bo cache.put(address, ref); } else if (ref.isForAdmin() && !forAdmin) { - // trace(address, "HIT: forAdmin -> !forAdmin"); + trace(address, "HIT: forAdmin -> !forAdmin"); ref.setForAdmin(false); obj = (T)ref.get(); obj.initForGC(); @@ -158,7 +158,7 @@ else if (ref.isForAdmin() && !forAdmin) { @SuppressWarnings("unchecked") static T objectForAddress(long address, boolean forAdmin) { - // trace("objectForAddress(address: %d, forAdmin: %s)", address, forAdmin); + trace("objectForAddress(address: %d, forAdmin: %s)", address, forAdmin); MemoryRegion valueRegion = new UncheckedPersistentMemoryRegion(address); long typeNameAddr = valueRegion.getLong(0); MemoryRegion typeNameRegion = new UncheckedPersistentMemoryRegion(typeNameAddr); @@ -181,31 +181,34 @@ static T objectForAddress(long address, boolean for } public static void remove(long address) { - // trace(address, "ObjectCache.remove"); + trace(address, "ObjectCache.remove"); cache.remove(address); } static void add(T obj) { - // trace(obj.getPointer().addr(), "ObjectCache.add"); + trace(obj.getPointer().addr(), "ObjectCache.add"); long address = obj.getPointer().addr(); // assert(cache.get(address) == null); Ref ref = new Ref<>(obj); cache.put(address, ref); + // FIXME: circulare dependency between package XRoot and this package XTransaction.addNewObject(obj); } static void registerObject(T obj) { - // trace(obj.getPointer().addr(), "register object"); + trace(obj.getPointer().addr(), "register object"); + // FIXME: circulare dependency between package XRoot and this package ((XRoot)(heap.getRoot())).registerObject(obj.getPointer().region().addr()); } static void deregisterObject(long addr) { - // trace(addr, "deregister object"); + trace(addr, "deregister object"); + // FIXME: circulare dependency between package XRoot and this package ((XRoot)(heap.getRoot())).deregisterObject(addr); } public static void committedConstruction(PersistentObject obj) { - // trace(obj.getPointer().addr(), "committedConstruction called"); + trace(obj.getPointer().addr(), "committedConstruction called"); new PRef(obj); } } diff --git a/src/main/java/lib/util/persistent/ObjectDirectory.java b/src/main/java/lib/util/persistent/ObjectDirectory.java index 25265dc..f6810c9 100644 --- a/src/main/java/lib/util/persistent/ObjectDirectory.java +++ b/src/main/java/lib/util/persistent/ObjectDirectory.java @@ -41,6 +41,7 @@ public static T remove(String s, Class cls) { } public static void initialize() { + // FIXME: Compatible only with the default provider map = PersistentMemoryProvider.getDefaultProvider().getHeap().getRoot().getObjectDirectory(); } } diff --git a/src/main/java/lib/util/persistent/Persistent.java b/src/main/java/lib/util/persistent/Persistent.java index a009a88..73e3837 100644 --- a/src/main/java/lib/util/persistent/Persistent.java +++ b/src/main/java/lib/util/persistent/Persistent.java @@ -21,10 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.PersistentField; -import java.util.List; -import java.util.Arrays; - public interface Persistent> //extends Reference { // public default ptr() {return getPointer();} diff --git a/src/main/java/lib/util/persistent/PersistentArray.java b/src/main/java/lib/util/persistent/PersistentArray.java index bd036d9..13b11be 100644 --- a/src/main/java/lib/util/persistent/PersistentArray.java +++ b/src/main/java/lib/util/persistent/PersistentArray.java @@ -23,10 +23,7 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; -import java.lang.reflect.Array; import java.util.Arrays; -import lib.xpersistent.*; -import lib.util.persistent.spi.PersistentMemoryProvider; public final class PersistentArray extends AbstractPersistentArray { private static final ArrayType TYPE = new ArrayType<>(PersistentArray.class, Types.OBJECT); diff --git a/src/main/java/lib/util/persistent/PersistentAtomicReference.java b/src/main/java/lib/util/persistent/PersistentAtomicReference.java index cc1224c..bde963e 100644 --- a/src/main/java/lib/util/persistent/PersistentAtomicReference.java +++ b/src/main/java/lib/util/persistent/PersistentAtomicReference.java @@ -23,7 +23,6 @@ import lib.util.persistent.types.*; import lib.util.persistent.types.ObjectType; -import java.util.concurrent.atomic.*; public final class PersistentAtomicReference extends PersistentObject { diff --git a/src/main/java/lib/util/persistent/PersistentBoolean.java b/src/main/java/lib/util/persistent/PersistentBoolean.java index 30a875e..5af4715 100644 --- a/src/main/java/lib/util/persistent/PersistentBoolean.java +++ b/src/main/java/lib/util/persistent/PersistentBoolean.java @@ -24,11 +24,14 @@ import lib.util.persistent.types.*; import lib.util.persistent.types.ObjectType; -import lib.util.persistent.types.Types; +import lib.util.persistent.front.PersistentClass; -public final class PersistentBoolean extends PersistentObject implements Comparable { +@PersistentClass +public final class PersistentBoolean extends PersistentObject + implements Comparable { private static final BooleanField BOOLEAN = new BooleanField(); private static final ObjectType TYPE = ObjectType.fromFields(PersistentBoolean.class, BOOLEAN); + private static final long serialVersionUID = 1L; public PersistentBoolean(boolean x) { super(TYPE); diff --git a/src/main/java/lib/util/persistent/PersistentBooleanArray.java b/src/main/java/lib/util/persistent/PersistentBooleanArray.java index f988bfd..fb574aa 100644 --- a/src/main/java/lib/util/persistent/PersistentBooleanArray.java +++ b/src/main/java/lib/util/persistent/PersistentBooleanArray.java @@ -24,8 +24,12 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentBooleanArray extends AbstractPersistentArray { +@PersistentClass +public final class PersistentBooleanArray + extends AbstractPersistentArray { + private static final long serialVersionUID = 1L; private static final ArrayType TYPE = new ArrayType<>(PersistentBooleanArray.class, Types.BOOLEAN); public PersistentBooleanArray(int size) { diff --git a/src/main/java/lib/util/persistent/PersistentByte.java b/src/main/java/lib/util/persistent/PersistentByte.java index cef4c5c..ab17ca6 100644 --- a/src/main/java/lib/util/persistent/PersistentByte.java +++ b/src/main/java/lib/util/persistent/PersistentByte.java @@ -24,11 +24,14 @@ import lib.util.persistent.types.*; import lib.util.persistent.types.ObjectType; -import lib.util.persistent.types.Types; +import lib.util.persistent.front.PersistentClass; -public final class PersistentByte extends PersistentObject implements Comparable { +@PersistentClass +public final class PersistentByte extends PersistentObject + implements Comparable { private static final ByteField BYTE = new ByteField(); private static final ObjectType TYPE = ObjectType.fromFields(PersistentByte.class, BYTE); + private static final long serialVersionUID = 1L; public PersistentByte(byte x) { super(TYPE); diff --git a/src/main/java/lib/util/persistent/PersistentByteArray.java b/src/main/java/lib/util/persistent/PersistentByteArray.java index cf6917a..041eab8 100644 --- a/src/main/java/lib/util/persistent/PersistentByteArray.java +++ b/src/main/java/lib/util/persistent/PersistentByteArray.java @@ -24,8 +24,12 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentByteArray extends AbstractPersistentArray { +@PersistentClass +public final class PersistentByteArray + extends AbstractPersistentArray { + private static final long serialVersionUID = 1L; private static final ArrayType TYPE = new ArrayType<>(PersistentByteArray.class, Types.BYTE); public PersistentByteArray(int size) { diff --git a/src/main/java/lib/util/persistent/PersistentCharArray.java b/src/main/java/lib/util/persistent/PersistentCharArray.java index 9454413..eb0af3d 100644 --- a/src/main/java/lib/util/persistent/PersistentCharArray.java +++ b/src/main/java/lib/util/persistent/PersistentCharArray.java @@ -24,8 +24,12 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentCharArray extends AbstractPersistentArray { +@PersistentClass +public final class PersistentCharArray + extends AbstractPersistentArray { + private static final long serialVersionUID = 1L; private static final ArrayType TYPE = new ArrayType<>(PersistentCharArray.class, Types.CHAR); public PersistentCharArray(int size) { diff --git a/src/main/java/lib/util/persistent/PersistentCharacter.java b/src/main/java/lib/util/persistent/PersistentCharacter.java index 4616b9f..975c89d 100644 --- a/src/main/java/lib/util/persistent/PersistentCharacter.java +++ b/src/main/java/lib/util/persistent/PersistentCharacter.java @@ -24,11 +24,14 @@ import lib.util.persistent.types.*; import lib.util.persistent.types.ObjectType; -import lib.util.persistent.types.Types; +import lib.util.persistent.front.PersistentClass; -public final class PersistentCharacter extends PersistentObject implements Comparable { +@PersistentClass +public final class PersistentCharacter extends PersistentObject + implements Comparable { private static final CharField CHAR = new CharField(); private static final ObjectType TYPE = ObjectType.fromFields(PersistentCharacter.class, CHAR); + private static final long serialVersionUID = 1L; public PersistentCharacter(char x) { super(TYPE); diff --git a/src/main/java/lib/util/persistent/PersistentDouble.java b/src/main/java/lib/util/persistent/PersistentDouble.java index dfad02b..aedf3b8 100644 --- a/src/main/java/lib/util/persistent/PersistentDouble.java +++ b/src/main/java/lib/util/persistent/PersistentDouble.java @@ -24,11 +24,14 @@ import lib.util.persistent.types.*; import lib.util.persistent.types.ObjectType; -import lib.util.persistent.types.Types; +import lib.util.persistent.front.PersistentClass; -public final class PersistentDouble extends PersistentObject implements Comparable { +@PersistentClass +public final class PersistentDouble extends PersistentObject + implements Comparable { private static final DoubleField DOUBLE = new DoubleField(); private static final ObjectType TYPE = ObjectType.fromFields(PersistentDouble.class, DOUBLE); + private static final long serialVersionUID = 1L; public PersistentDouble(double x) { super(TYPE); diff --git a/src/main/java/lib/util/persistent/PersistentDoubleArray.java b/src/main/java/lib/util/persistent/PersistentDoubleArray.java index 30d2180..33a481f 100644 --- a/src/main/java/lib/util/persistent/PersistentDoubleArray.java +++ b/src/main/java/lib/util/persistent/PersistentDoubleArray.java @@ -24,8 +24,12 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentDoubleArray extends AbstractPersistentArray { +@PersistentClass +public final class PersistentDoubleArray + extends AbstractPersistentArray { + private static final long serialVersionUID = 1L; private static final ArrayType TYPE = new ArrayType<>(PersistentDoubleArray.class, Types.DOUBLE); public PersistentDoubleArray(int size) { diff --git a/src/main/java/lib/util/persistent/PersistentFloat.java b/src/main/java/lib/util/persistent/PersistentFloat.java index 14283f9..a41bdd2 100644 --- a/src/main/java/lib/util/persistent/PersistentFloat.java +++ b/src/main/java/lib/util/persistent/PersistentFloat.java @@ -24,11 +24,14 @@ import lib.util.persistent.types.*; import lib.util.persistent.types.ObjectType; -import lib.util.persistent.types.Types; +import lib.util.persistent.front.PersistentClass; -public final class PersistentFloat extends PersistentObject implements Comparable { +@PersistentClass +public final class PersistentFloat extends PersistentObject + implements Comparable { private static final FloatField FLOAT = new FloatField(); private static final ObjectType TYPE = ObjectType.fromFields(PersistentFloat.class, FLOAT); + private static final long serialVersionUID = 1L; public PersistentFloat(float x) { super(TYPE); diff --git a/src/main/java/lib/util/persistent/PersistentFloatArray.java b/src/main/java/lib/util/persistent/PersistentFloatArray.java index 7edc398..afb214b 100644 --- a/src/main/java/lib/util/persistent/PersistentFloatArray.java +++ b/src/main/java/lib/util/persistent/PersistentFloatArray.java @@ -24,8 +24,12 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentFloatArray extends AbstractPersistentArray { +@PersistentClass +public final class PersistentFloatArray + extends AbstractPersistentArray { + private static final long serialVersionUID = 1L; private static final ArrayType TYPE = new ArrayType<>(PersistentFloatArray.class, Types.FLOAT); public PersistentFloatArray(int size) { diff --git a/src/main/java/lib/util/persistent/PersistentHashMap.java b/src/main/java/lib/util/persistent/PersistentHashMap.java index 97e9adf..669819d 100644 --- a/src/main/java/lib/util/persistent/PersistentHashMap.java +++ b/src/main/java/lib/util/persistent/PersistentHashMap.java @@ -136,7 +136,7 @@ final class Values extends AbstractCollection { public synchronized final int size() { return PersistentHashMap.this.size(); } public final void clear() { /* NIY */ } public final Iterator iterator() { return new ValueIterator(); } - public synchronized final boolean contains(Object o) { return containsValue(o); } + public synchronized final boolean contains(V o) { return containsValue(o); } public final Spliterator spliterator() { throw new UnsupportedOperationException(); } @@ -159,7 +159,7 @@ final class KeySet extends AbstractSet { public synchronized final int size() { return PersistentHashMap.this.size(); } public final void clear() { /* NIY */ } public final Iterator iterator() { return new KeyIterator(); } - public synchronized final boolean contains(Object o) { return containsKey(o); } + public synchronized final boolean contains(K o) { return containsKey(o); } public final Spliterator spliterator() { throw new UnsupportedOperationException(); } @@ -297,12 +297,12 @@ public synchronized V put(K key, V value) { return ret.get(); } - public synchronized V get(Object key) { + public synchronized V get(K key) { Node e; return (e = getNode(hash(key), key)) == null ? null : e.getValue(); } - public synchronized V remove(Object key) { + public synchronized V remove(K key) { Node e; return (e = removeNode(hash(key), key, null, false, true)) == null ? null : e.getValue(); } @@ -322,11 +322,11 @@ public Collection values() { return (vs = values) == null ? (values = new Values()) : vs; } - public synchronized boolean containsKey(Object key) { + public synchronized boolean containsKey(K key) { return getNode(hash(key), key) != null; } - public synchronized boolean containsValue(Object value) { + public synchronized boolean containsValue(V value) { PersistentArray> tab; V v; if ((tab = table()) != null && size() > 0) { diff --git a/src/main/java/lib/util/persistent/PersistentImmutableBooleanArray.java b/src/main/java/lib/util/persistent/PersistentImmutableBooleanArray.java index 03713b0..3c79ef5 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableBooleanArray.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableBooleanArray.java @@ -24,8 +24,12 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentImmutableBooleanArray extends AbstractPersistentImmutableArray { +@PersistentClass +public final class PersistentImmutableBooleanArray + extends AbstractPersistentImmutableArray { + private static final long serialVersionUID = 1L; private static final ArrayType TYPE = new ArrayType<>(PersistentImmutableBooleanArray.class, Types.BOOLEAN); public PersistentImmutableBooleanArray(boolean[] array) { diff --git a/src/main/java/lib/util/persistent/PersistentImmutableByteArray.java b/src/main/java/lib/util/persistent/PersistentImmutableByteArray.java index b05cf53..ca001b3 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableByteArray.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableByteArray.java @@ -24,8 +24,12 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentImmutableByteArray extends AbstractPersistentImmutableArray { +@PersistentClass +public final class PersistentImmutableByteArray + extends AbstractPersistentImmutableArray { + private static final long serialVersionUID = 1L; private static final ArrayType TYPE = new ArrayType<>(PersistentImmutableByteArray.class, Types.BYTE); public PersistentImmutableByteArray(byte[] array) { diff --git a/src/main/java/lib/util/persistent/PersistentImmutableCharArray.java b/src/main/java/lib/util/persistent/PersistentImmutableCharArray.java index eb43053..bc3bd72 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableCharArray.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableCharArray.java @@ -24,8 +24,12 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentImmutableCharArray extends AbstractPersistentImmutableArray { +@PersistentClass +public final class PersistentImmutableCharArray + extends AbstractPersistentImmutableArray { + private static final long serialVersionUID = 1L; private static final ArrayType TYPE = new ArrayType<>(PersistentImmutableCharArray.class, Types.CHAR); public PersistentImmutableCharArray(char[] array) { diff --git a/src/main/java/lib/util/persistent/PersistentImmutableDoubleArray.java b/src/main/java/lib/util/persistent/PersistentImmutableDoubleArray.java index 76baf2f..e62d3aa 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableDoubleArray.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableDoubleArray.java @@ -24,8 +24,12 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentImmutableDoubleArray extends AbstractPersistentImmutableArray { +@PersistentClass +public final class PersistentImmutableDoubleArray + extends AbstractPersistentImmutableArray { + private static final long serialVersionUID = 1L; private static final ArrayType TYPE = new ArrayType<>(PersistentImmutableDoubleArray.class, Types.DOUBLE); public PersistentImmutableDoubleArray(double[] array) { diff --git a/src/main/java/lib/util/persistent/PersistentImmutableFloatArray.java b/src/main/java/lib/util/persistent/PersistentImmutableFloatArray.java index 3524702..12d284e 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableFloatArray.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableFloatArray.java @@ -24,8 +24,12 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentImmutableFloatArray extends AbstractPersistentImmutableArray { +@PersistentClass +public final class PersistentImmutableFloatArray + extends AbstractPersistentImmutableArray { + private static final long serialVersionUID = 1L; private static final ArrayType TYPE = new ArrayType<>(PersistentImmutableFloatArray.class, Types.FLOAT); public PersistentImmutableFloatArray(float[] array) { diff --git a/src/main/java/lib/util/persistent/PersistentImmutableIntArray.java b/src/main/java/lib/util/persistent/PersistentImmutableIntArray.java index 1ec1a82..2be49ea 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableIntArray.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableIntArray.java @@ -24,8 +24,12 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentImmutableIntArray extends AbstractPersistentImmutableArray { +@PersistentClass +public final class PersistentImmutableIntArray + extends AbstractPersistentImmutableArray { + private static final long serialVersionUID = 1L; private static final ArrayType TYPE = new ArrayType<>(PersistentImmutableIntArray.class, Types.INT); public PersistentImmutableIntArray(int[] array) { diff --git a/src/main/java/lib/util/persistent/PersistentImmutableLongArray.java b/src/main/java/lib/util/persistent/PersistentImmutableLongArray.java index cb624d8..7a0fefd 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableLongArray.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableLongArray.java @@ -24,8 +24,12 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentImmutableLongArray extends AbstractPersistentImmutableArray { +@PersistentClass +public final class PersistentImmutableLongArray + extends AbstractPersistentImmutableArray { + private static final long serialVersionUID = 1L; private static final ArrayType TYPE = new ArrayType<>(PersistentImmutableLongArray.class, Types.LONG); public PersistentImmutableLongArray(long[] array) { diff --git a/src/main/java/lib/util/persistent/PersistentImmutableShortArray.java b/src/main/java/lib/util/persistent/PersistentImmutableShortArray.java index bf038d6..4e7ca93 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableShortArray.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableShortArray.java @@ -24,8 +24,12 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentImmutableShortArray extends AbstractPersistentImmutableArray { +@PersistentClass +public final class PersistentImmutableShortArray + extends AbstractPersistentImmutableArray { + private static final long serialVersionUID = 1L; private static final ArrayType TYPE = new ArrayType<>(PersistentImmutableShortArray.class, Types.SHORT); public PersistentImmutableShortArray(short[] array) { diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple1.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple1.java index ac9e48b..c26bc9c 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple1.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple1.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple1 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentImmutableTuple1.class, FIELD1); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple10.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple10.java index 0f6cf86..87854cb 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple10.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple10.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple10 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple11.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple11.java index 5ec7a36..686fdcd 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple11.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple11.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple11 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple12.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple12.java index 411e255..c228af5 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple12.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple12.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple12 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple13.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple13.java index ee2c8e6..cdf1d0e 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple13.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple13.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple13 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple14.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple14.java index 31c3c10..83f4c0b 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple14.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple14.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple14 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple15.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple15.java index 5a61981..d3ff16b 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple15.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple15.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple15 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple16.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple16.java index eb91fdf..a9126e3 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple16.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple16.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple16 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple17.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple17.java index 3a7871f..2b458e7 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple17.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple17.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple17 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple18.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple18.java index 35b3c57..fbf2613 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple18.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple18.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple18 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple19.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple19.java index f512646..5073d5f 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple19.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple19.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple19 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple2.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple2.java index 7c41ecc..4ffc2cc 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple2.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple2.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple2 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentImmutableTuple2.class, FIELD1, FIELD2); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple20.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple20.java index f92c571..51ada51 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple20.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple20.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple20 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple21.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple21.java index 2340edc..e70b23c 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple21.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple21.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple21 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple22.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple22.java index be2259c..42c2d97 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple22.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple22.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple22 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple3.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple3.java index eb1e710..e1d9446 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple3.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple3.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple3 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple4.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple4.java index e91e9fe..b2e50e7 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple4.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple4.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple4 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple5.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple5.java index 75949c4..deac9b1 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple5.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple5.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple5 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple6.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple6.java index 4a5aa5e..dc1329d 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple6.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple6.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple6 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple7.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple7.java index 189e610..b5a0fa7 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple7.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple7.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple7 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple8.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple8.java index 80381c9..8be5858 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple8.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple8.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple8 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentImmutableTuple9.java b/src/main/java/lib/util/persistent/PersistentImmutableTuple9.java index eb18894..ba4abd4 100644 --- a/src/main/java/lib/util/persistent/PersistentImmutableTuple9.java +++ b/src/main/java/lib/util/persistent/PersistentImmutableTuple9.java @@ -26,8 +26,11 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; +@PersistentClass public class PersistentImmutableTuple9 extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); diff --git a/src/main/java/lib/util/persistent/PersistentIntArray.java b/src/main/java/lib/util/persistent/PersistentIntArray.java index 5b13fe1..0f1f268 100644 --- a/src/main/java/lib/util/persistent/PersistentIntArray.java +++ b/src/main/java/lib/util/persistent/PersistentIntArray.java @@ -24,8 +24,12 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentIntArray extends AbstractPersistentArray { +@PersistentClass +public final class PersistentIntArray + extends AbstractPersistentArray { + private static final long serialVersionUID = 1L; private static final ArrayType TYPE = new ArrayType<>(PersistentIntArray.class, Types.INT); public PersistentIntArray(int size) { diff --git a/src/main/java/lib/util/persistent/PersistentInteger.java b/src/main/java/lib/util/persistent/PersistentInteger.java index adbf119..88fc209 100644 --- a/src/main/java/lib/util/persistent/PersistentInteger.java +++ b/src/main/java/lib/util/persistent/PersistentInteger.java @@ -24,11 +24,14 @@ import lib.util.persistent.types.*; import lib.util.persistent.types.ObjectType; -import lib.util.persistent.types.Types; +import lib.util.persistent.front.PersistentClass; -public final class PersistentInteger extends PersistentObject implements Comparable { +@PersistentClass +public final class PersistentInteger extends PersistentObject + implements Comparable { private static final IntField INT = new IntField(); private static final ObjectType TYPE = ObjectType.fromFields(PersistentInteger.class, INT); + private static final long serialVersionUID = 1L; public PersistentInteger(int x) { super(TYPE); diff --git a/src/main/java/lib/util/persistent/PersistentLinkedList.java b/src/main/java/lib/util/persistent/PersistentLinkedList.java index cf4dd45..88bf1b4 100644 --- a/src/main/java/lib/util/persistent/PersistentLinkedList.java +++ b/src/main/java/lib/util/persistent/PersistentLinkedList.java @@ -23,7 +23,6 @@ import lib.util.persistent.types.*; import lib.util.persistent.types.ObjectType; -import java.lang.StringBuilder; import java.util.Iterator; import java.util.NoSuchElementException; diff --git a/src/main/java/lib/util/persistent/PersistentLinkedQueue.java b/src/main/java/lib/util/persistent/PersistentLinkedQueue.java index e81f4a0..3999963 100644 --- a/src/main/java/lib/util/persistent/PersistentLinkedQueue.java +++ b/src/main/java/lib/util/persistent/PersistentLinkedQueue.java @@ -21,15 +21,10 @@ package lib.util.persistent; -import lib.util.persistent.types.*; +import lib.util.persistent.types.ObjectField; import lib.util.persistent.types.ObjectType; -import java.util.concurrent.atomic.*; -import java.lang.StringBuilder; -import java.util.Collection; -import java.util.Queue; -import java.util.NoSuchElementException; -import java.util.ArrayList; -import java.util.Iterator; + +import java.util.*; public class PersistentLinkedQueue extends PersistentObject implements Iterable { diff --git a/src/main/java/lib/util/persistent/PersistentLong.java b/src/main/java/lib/util/persistent/PersistentLong.java index 99314bb..fd81d7f 100644 --- a/src/main/java/lib/util/persistent/PersistentLong.java +++ b/src/main/java/lib/util/persistent/PersistentLong.java @@ -24,11 +24,14 @@ import lib.util.persistent.types.*; import lib.util.persistent.types.ObjectType; -import lib.util.persistent.types.Types; +import lib.util.persistent.front.PersistentClass; -public final class PersistentLong extends PersistentObject implements Comparable { +@PersistentClass +public final class PersistentLong extends PersistentObject + implements Comparable { private static final LongField LONG = new LongField(); private static final ObjectType TYPE = ObjectType.fromFields(PersistentLong.class, LONG); + private static final long serialVersionUID = 1L; public PersistentLong(long x) { super(TYPE); diff --git a/src/main/java/lib/util/persistent/PersistentLongArray.java b/src/main/java/lib/util/persistent/PersistentLongArray.java index aa17eb8..7beb916 100644 --- a/src/main/java/lib/util/persistent/PersistentLongArray.java +++ b/src/main/java/lib/util/persistent/PersistentLongArray.java @@ -24,8 +24,12 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentLongArray extends AbstractPersistentArray { +@PersistentClass +public final class PersistentLongArray + extends AbstractPersistentArray { + private static final long serialVersionUID = 1L; private static final ArrayType TYPE = new ArrayType<>(PersistentLongArray.class, Types.LONG); public PersistentLongArray(int size) { diff --git a/src/main/java/lib/util/persistent/PersistentObject.java b/src/main/java/lib/util/persistent/PersistentObject.java index 868874f..757605b 100755 --- a/src/main/java/lib/util/persistent/PersistentObject.java +++ b/src/main/java/lib/util/persistent/PersistentObject.java @@ -26,7 +26,6 @@ import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ValueType; import lib.util.persistent.types.ArrayType; -import lib.util.persistent.types.CarriedType; import lib.util.persistent.types.ByteField; import lib.util.persistent.types.ShortField; import lib.util.persistent.types.IntField; @@ -37,8 +36,10 @@ import lib.util.persistent.types.BooleanField; import lib.util.persistent.types.ObjectField; import lib.util.persistent.types.ValueField; -import lib.util.persistent.types.PersistentField; import lib.util.persistent.spi.PersistentMemoryProvider; + +import java.io.ObjectStreamClass; +import java.io.Serializable; import java.util.List; import java.util.ArrayList; import java.util.Deque; @@ -54,7 +55,8 @@ import sun.misc.Unsafe; @SuppressWarnings("sunapi") -public class PersistentObject implements Persistent { +public class PersistentObject implements Persistent, Serializable { + // FIXME: Compatible only with the default provider static final PersistentHeap heap = PersistentMemoryProvider.getDefaultProvider().getHeap(); private static Random random = new Random(System.nanoTime()); public static Unsafe UNSAFE; @@ -62,6 +64,7 @@ public class PersistentObject implements Persistent { // for stats static { try { + // Warning: With Java9, Unsafe is not accisble java.lang.reflect.Field f = Unsafe.class.getDeclaredField("theUnsafe"); f.setAccessible(true); UNSAFE = (Unsafe)f.get(null); @@ -71,37 +74,59 @@ public class PersistentObject implements Persistent { } } - private final ObjectPointer pointer; + private ObjectPointer pointer; - public PersistentObject(ObjectType type) { - // would like to group the allocation transaction and initialization transaction - // can't just put one here because this constructor call must be first line - // Transaction.run(() -> { - this(type, PersistentMemoryProvider.getDefaultProvider().getHeap().allocateRegion(type.getAllocationSize())); - // }); + protected void init(ObjectType type) { + // PPR: associate with the DefaultProvider. It's impossible to use another provider + init(type,PersistentMemoryProvider.getDefaultProvider().getHeap().allocateRegion(type.getAllocationSize())); } - PersistentObject(ObjectType type, MemoryRegion region) { - // trace(region.addr(), "creating object of type %s", type.getName()); + protected void init(ObjectType type,MemoryRegion region) { + trace(region.addr(), "creating object of type %s", type.getName()); this.pointer = new ObjectPointer(type, region); List ts = type.getTypes(); Transaction.run(() -> { for (int i = 0; i < ts.size(); i++) initializeField(i, ts.get(i)); setTypeName(type.getName()); - setVersion(99); + long serialVersionUID = ObjectStreamClass.lookup(type.cls()).getSerialVersionUID(); + setVersion(serialVersionUID); initForGC(); - if (heap instanceof XHeap && ((XHeap)heap).getDebugMode() == true) { + // FIXME: Compatible only with the default provider + // FIXME: circulare dependency between package XRoot and this package + if (heap instanceof XHeap && ((XHeap)heap).getDebugMode()) { ((XRoot)(heap.getRoot())).addToAllObjects(getPointer().region().addr()); } }, this); ObjectCache.add(this); } - public PersistentObject(ObjectPointer p) { - // trace(p.region().addr(), "recreating object"); + protected void init(ObjectPointer p) { + trace(p.region().addr(), "recreating object"); this.pointer = p; } + + protected PersistentObject() { } + + public PersistentObject(ObjectType type) { + Transaction.run(() -> { + init(type); + }); + } + + public PersistentObject(ObjectPointer p) { + trace(p.region().addr(), "recreating object"); + Transaction.run(() -> { + init(p); + }); + } + + protected PersistentObject(ObjectType type, MemoryRegion region) { + Transaction.run(() -> { + init(type,region); + }); + } + void initForGC() { Transaction.run(() -> { incRefCount(); @@ -112,7 +137,7 @@ void initForGC() { // only called by Root during bootstrap of Object directory PersistentHashMap @SuppressWarnings("unchecked") public static T fromPointer(ObjectPointer p) { - // trace(p.addr(), "creating object from pointer of type %s", p.type().getName()); + trace(p.addr(), "creating object from pointer of type %s", p.type().getName()); try { Class cls = p.type().cls(); Constructor ctor = cls.getDeclaredConstructor(ObjectPointer.class); @@ -125,15 +150,16 @@ public static T fromPointer(ObjectPointer p) { } static void free(long addr) { - // trace(addr, "free called"); + trace(addr, "free called"); ObjectCache.remove(addr); MemoryRegion reg = new UncheckedPersistentMemoryRegion(addr); MemoryRegion nameRegion = new UncheckedPersistentMemoryRegion(reg.getInt(Header.TYPE.getOffset(Header.TYPE_NAME))); Transaction.run(() -> { - // trace(addr, "freeing object region %d and name region %d", reg.addr(), nameRegion.addr()); + trace(addr, "freeing object region %d and name region %d", reg.addr(), nameRegion.addr()); heap.freeRegion(nameRegion); heap.freeRegion(reg); - if (heap instanceof XHeap && ((XHeap)heap).getDebugMode() == true) { + // FIXME: circulare dependency between package XRoot and this package + if (heap instanceof XHeap && ((XHeap)heap).getDebugMode()) { ((XRoot)(heap.getRoot())).removeFromAllObjects(addr); } CycleCollector.removeFromCandidates(addr); @@ -229,10 +255,11 @@ void setObject(long offset, PersistentObject value) { public synchronized T getValueField(ValueField f) { MemoryRegion srcRegion = getPointer().region(); MemoryRegion dstRegion = heap.allocateRegion(f.getType().getSize()); - // trace("getValueField src addr = %d, dst addr = %d, size = %d", srcRegion.addr(), dstRegion.addr(), f.getType().getSize()); + trace("getValueField src addr = %d, dst addr = %d, size = %d", srcRegion.addr(), dstRegion.addr(), f.getType().getSize()); synchronized(srcRegion) { synchronized(dstRegion) { - ((lib.xpersistent.XHeap)heap).memcpy(srcRegion, offset(f.getIndex()), dstRegion, 0, f.getType().getSize()); + // FIXME: circulare dependency between package XRoot and this package + ((XHeap)heap).memcpy(srcRegion, offset(f.getIndex()), dstRegion, 0, f.getType().getSize()); } } return (T)new ValuePointer((ValueType)f.getType(), dstRegion, f.cls()).deref(); @@ -242,9 +269,10 @@ public synchronized void setValueField(ValueField MemoryRegion dstRegion = getPointer().region(); long dstOffset = offset(f.getIndex()); MemoryRegion srcRegion = value.getPointer().region(); - // trace("setValueField src addr = %d, dst addr = %d, size = %d", srcRegion.addr(), dstRegion.addr() + dstOffset, f.getType().getSize()); + trace("setValueField src addr = %d, dst addr = %d, size = %d", srcRegion.addr(), dstRegion.addr() + dstOffset, f.getType().getSize()); synchronized(srcRegion) { - ((lib.xpersistent.XHeap)heap).memcpy(srcRegion, 0, dstRegion, dstOffset, f.getType().getSize()); + // FIXME: circulare dependency between package XRoot and this package + ((XHeap)heap).memcpy(srcRegion, 0, dstRegion, dstOffset, f.getType().getSize()); } } @@ -314,12 +342,12 @@ private int check(int index, PersistentType testType) { return index; } - private int getVersion() { - return getIntField(Header.VERSION); + private long getVersion() { + return getLongField(Header.VERSION); } - private void setVersion(int version) { - setIntField(Header.VERSION, version); + private void setVersion(long version) { + setLongField(Header.VERSION, version); } private void setTypeName(String name) { @@ -343,7 +371,7 @@ void incRefCount() { Transaction.run(() -> { int oldCount = reg.getInt(Header.TYPE.getOffset(Header.REF_COUNT)); reg.putInt(Header.TYPE.getOffset(Header.REF_COUNT), oldCount + 1); - // trace(getPointer().addr(), "incRefCount(), type = %s, old = %d, new = %d",getPointer().type(), oldCount, getRefCount()); + trace(getPointer().addr(), "incRefCount(), type = %s, old = %d, new = %d",getPointer().type(), oldCount, getRefCount()); }, this); } @@ -353,10 +381,11 @@ int decRefCount() { Transaction.run(() -> { int oldCount = reg.getInt(Header.TYPE.getOffset(Header.REF_COUNT)); newCount.set(oldCount - 1); - // trace(getPointer().addr(), "decRefCount, type = %s, old = %d, new = %d", getPointer().type(), oldCount, newCount.get()); + trace(getPointer().addr(), "decRefCount, type = %s, old = %d, new = %d", getPointer().type(), oldCount, newCount.get()); if (newCount.get() < 0) { - // trace(reg.addr(), "decRef below 0"); - new RuntimeException().printStackTrace(); System.exit(-1);} + trace(reg.addr(), "decRef below 0"); + throw new HeapCorruptedError(reg.addr()+" decRef below 0"); + } reg.putInt(Header.TYPE.getOffset(Header.REF_COUNT), newCount.get()); }, this); return newCount.get(); @@ -376,7 +405,7 @@ synchronized void deleteReference() { int count = 0; int newCount = decRefCount(); if (newCount == 0) { - // trace(getPointer().addr(), "deleteReference, newCount == 0"); + trace(getPointer().addr(), "deleteReference, newCount == 0"); addrsToDelete.push(getPointer().addr()); while (!addrsToDelete.isEmpty()) { long addrToDelete = addrsToDelete.pop(); @@ -406,14 +435,14 @@ synchronized void deleteReference() { }, this); } + // Call by JNI static void deleteResidualReferences(long address, int count) { PersistentObject obj = ObjectCache.get(address, true); Transaction.run(() -> { int rc = obj.getRefCount(); - // trace(address, "deleteResidualReferences %d, refCount = %d", count, obj.getRefCount()); + trace(address, "deleteResidualReferences %d, refCount = %d", count, obj.getRefCount()); if (obj.getRefCount() < count) { - System.out.println("refcount < count"); - System.exit(-1); + throw new HeapCorruptedError("refcount < count"); } for (int i = 0; i < count - 1; i++) obj.decRefCount(); obj.deleteReference(); @@ -471,31 +500,31 @@ byte getColor() { static final int TIMEOUT = 125_000_000; // ns public static boolean monitorEnter(List toLock, List locked) { - // trace("monitorEnter (lists), starting toLock = %d, locked = %d", toLock.size(), locked.size()); + trace("monitorEnter (lists), starting toLock = %d, locked = %d", toLock.size(), locked.size()); // toLock.sort((x, y) -> Long.compare(x.getPointer().addr(), y.getPointer().addr())); boolean success = true; for (PersistentObject obj : toLock) { if (!obj.monitorEnterTimeout(TIMEOUT)) { success = false; - // trace("TIMEOUT exceeded"); + trace("TIMEOUT exceeded"); for(PersistentObject lockedObj : locked) { lockedObj.monitorExit(); - // trace("removed locked obj %d", obj.getPointer().addr()); + trace("removed locked obj %d", obj.getPointer().addr()); } locked.clear(); break; } else { locked.add(obj); - // trace("added locked obj %d", obj.getPointer().addr()); + trace("added locked obj %d", obj.getPointer().addr()); } } - // trace("monitorEnter (lists), exiting toLock = %d, locked = %d", toLock.size(), locked.size()); + trace("monitorEnter (lists), exiting toLock = %d, locked = %d", toLock.size(), locked.size()); return success; } public boolean monitorEnterTimeout(long timeout) { - // trace(getPointer().addr(), "trying to acquire"); + trace(getPointer().addr(), "trying to acquire"); boolean success = false; long start = System.nanoTime(); long max = TIMEOUT + random.nextInt(TIMEOUT); @@ -516,6 +545,7 @@ public boolean monitorEnterTimeout(long timeout) { public void monitorExit() { UNSAFE.monitorExit(this); - // trace(getPointer().addr(), "released"); + trace(getPointer().addr(), "released"); } } + diff --git a/src/main/java/lib/util/persistent/PersistentShort.java b/src/main/java/lib/util/persistent/PersistentShort.java index d4ee65f..22802b2 100644 --- a/src/main/java/lib/util/persistent/PersistentShort.java +++ b/src/main/java/lib/util/persistent/PersistentShort.java @@ -24,11 +24,14 @@ import lib.util.persistent.types.*; import lib.util.persistent.types.ObjectType; -import lib.util.persistent.types.Types; +import lib.util.persistent.front.PersistentClass; -public final class PersistentShort extends PersistentObject implements Comparable { +@PersistentClass +public final class PersistentShort extends PersistentObject + implements Comparable { private static final ShortField SHORT = new ShortField(); private static final ObjectType TYPE = ObjectType.fromFields(PersistentShort.class, SHORT); + private static final long serialVersionUID = 1L; public PersistentShort(short x) { super(TYPE); diff --git a/src/main/java/lib/util/persistent/PersistentShortArray.java b/src/main/java/lib/util/persistent/PersistentShortArray.java index f4cc994..052b083 100644 --- a/src/main/java/lib/util/persistent/PersistentShortArray.java +++ b/src/main/java/lib/util/persistent/PersistentShortArray.java @@ -24,8 +24,12 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ArrayType; +import lib.util.persistent.front.PersistentClass; -public final class PersistentShortArray extends AbstractPersistentArray { +@PersistentClass +public final class PersistentShortArray + extends AbstractPersistentArray { + private static final long serialVersionUID = 1L; private static final ArrayType TYPE = new ArrayType<>(PersistentShortArray.class, Types.SHORT); public PersistentShortArray(int size) { diff --git a/src/main/java/lib/util/persistent/PersistentSkipListMap.java b/src/main/java/lib/util/persistent/PersistentSkipListMap.java index 47c7588..60298cc 100644 --- a/src/main/java/lib/util/persistent/PersistentSkipListMap.java +++ b/src/main/java/lib/util/persistent/PersistentSkipListMap.java @@ -581,7 +581,7 @@ final Node findFirst() { } } - private Map.Entry doRemoveFirstEntry() { + private Entry doRemoveFirstEntry() { for (Node b, n;;) { if ((n = (b = head().node()).next()) == null) return null; @@ -618,7 +618,7 @@ private void clearIndexToFirst() { } } - private Map.Entry doRemoveLastEntry() { + private Entry doRemoveLastEntry() { for (;;) { Node b = findPredecessorOfLast(); Node n = b.next(); @@ -886,10 +886,10 @@ private void buildFromSorted(SortedMap map) { q = q.down(); } - Iterator> it = + Iterator> it = map.entrySet().iterator(); while (it.hasNext()) { - Map.Entry e = it.next(); + Entry e = it.next(); int rnd = ThreadLocalRandom.current().nextInt(); int j = 0; if ((rnd & 0x80000001) == 0) { @@ -1076,7 +1076,7 @@ public Collection values() { return (vs != null) ? vs : (values = new Values(this)); } - public Set> entrySet() { + public Set> entrySet() { EntrySet es = entrySet; return (es != null) ? es : (entrySet = new EntrySet(this)); } @@ -1092,18 +1092,20 @@ public NavigableSet descendingKeySet() { } /* ---------------- AbstractMap Overrides -------------- */ - - public boolean equals(PersistentObject o) { + @Override + public boolean equals(Object oo) { + if (!(oo instanceof PersistentObject)) return false; + PersistentObject o=(PersistentObject)oo; if (o == this) return true; if (!(o instanceof PersistentSkipListMap)) return false; PersistentSkipListMap m = (PersistentSkipListMap) o; try { - for (Map.Entry e : this.entrySet()) + for (Entry e : this.entrySet()) if (! e.getValue().equals(m.get(e.getKey()))) return false; - for (Map.Entry e : m.entrySet()) { + for (Entry e : m.entrySet()) { PersistentObject k = e.getKey(); PersistentObject v = e.getValue(); if (k == null || v == null || !v.equals(get(k))) @@ -1117,10 +1119,15 @@ public boolean equals(PersistentObject o) { } } + @Override + public int hashCode() { + return entrySet().hashCode(); + } + public void putAll(Map m) { synchronized(head()) { Transaction.run(() -> { - for (Map.Entry e : m.entrySet()) + for (Entry e : m.entrySet()) put(e.getKey(), e.getValue()); }); } @@ -1231,7 +1238,7 @@ public ConcurrentNavigableMap tailMap(K fromKey) { /* ---------------- Relational operations -------------- */ - public Map.Entry lowerEntry(K key) { + public Entry lowerEntry(K key) { return getNear(key, LT); } @@ -1240,7 +1247,7 @@ public K lowerKey(K key) { return (n == null) ? null : n.key(); } - public Map.Entry floorEntry(K key) { + public Entry floorEntry(K key) { return getNear(key, LT|EQ); } @@ -1249,7 +1256,7 @@ public K floorKey(K key) { return (n == null) ? null : n.key(); } - public Map.Entry ceilingEntry(K key) { + public Entry ceilingEntry(K key) { return getNear(key, GT|EQ); } @@ -1258,7 +1265,7 @@ public K ceilingKey(K key) { return (n == null) ? null : n.key(); } - public Map.Entry higherEntry(K key) { + public Entry higherEntry(K key) { return getNear(key, GT); } @@ -1267,7 +1274,7 @@ public K higherKey(K key) { return (n == null) ? null : n.key(); } - public Map.Entry firstEntry() { + public Entry firstEntry() { for (;;) { Node n = findFirst(); if (n == null) @@ -1278,7 +1285,7 @@ public Map.Entry firstEntry() { } } - public Map.Entry lastEntry() { + public Entry lastEntry() { for (;;) { Node n = findLast(); if (n == null) @@ -1289,11 +1296,11 @@ public Map.Entry lastEntry() { } } - public Map.Entry pollFirstEntry() { + public Entry pollFirstEntry() { return doRemoveFirstEntry(); } - public Map.Entry pollLastEntry() { + public Entry pollLastEntry() { return doRemoveLastEntry(); } @@ -1366,8 +1373,8 @@ public K next() { } } - final class EntryIterator extends Iter> { - public Map.Entry next() { + final class EntryIterator extends Iter> { + public Entry next() { Node n = next; V v = nextValue; advance(); @@ -1383,7 +1390,7 @@ Iterator valueIterator() { return new ValueIterator(); } - Iterator> entryIterator() { + Iterator> entryIterator() { return new EntryIterator(); } @@ -1401,33 +1408,49 @@ static final class KeySet extends AbstractSet implements NavigableSet { final ConcurrentNavigableMap m; KeySet(ConcurrentNavigableMap map) { m = map; } + @Override public int size() { return m.size(); } + @Override public boolean isEmpty() { return m.isEmpty(); } + @Override public boolean contains(Object o) { return m.containsKey(o); } + @Override public boolean remove(Object o) { return m.remove(o) != null; } + @Override public void clear() { m.clear(); } + @Override public E lower(E e) { return m.lowerKey(e); } + @Override public E floor(E e) { return m.floorKey(e); } + @Override public E ceiling(E e) { return m.ceilingKey(e); } + @Override public E higher(E e) { return m.higherKey(e); } + @Override public Comparator comparator() { return m.comparator(); } + @Override public E first() { return m.firstKey(); } + @Override public E last() { return m.lastKey(); } + @Override public E pollFirst() { - Map.Entry e = m.pollFirstEntry(); + Entry e = m.pollFirstEntry(); return (e == null) ? null : e.getKey(); } + @Override public E pollLast() { - Map.Entry e = m.pollLastEntry(); + Entry e = m.pollLastEntry(); return (e == null) ? null : e.getKey(); } @SuppressWarnings("unchecked") + @Override public Iterator iterator() { if (m instanceof PersistentSkipListMap) return ((PersistentSkipListMap)m).keyIterator(); else - return ((PersistentSkipListMap.SubMap)m).keyIterator(); + return ((SubMap)m).keyIterator(); } + @Override public boolean equals(Object o) { if (o == this) return true; @@ -1442,11 +1465,19 @@ public boolean equals(Object o) { return false; } } + @Override + public int hashCode() { + return m.hashCode(); + } + @Override public Object[] toArray() { return toList(this).toArray(); } + @Override public T[] toArray(T[] a) { return toList(this).toArray(a); } + @Override public Iterator descendingIterator() { return descendingSet().iterator(); } + @Override public NavigableSet subSet(E fromElement, boolean fromInclusive, E toElement, @@ -1454,25 +1485,32 @@ public NavigableSet subSet(E fromElement, return new KeySet(m.subMap(fromElement, fromInclusive, toElement, toInclusive)); } + @Override public NavigableSet headSet(E toElement, boolean inclusive) { return new KeySet(m.headMap(toElement, inclusive)); } + @Override public NavigableSet tailSet(E fromElement, boolean inclusive) { return new KeySet(m.tailMap(fromElement, inclusive)); } + @Override public NavigableSet subSet(E fromElement, E toElement) { return subSet(fromElement, true, toElement, false); } + @Override public NavigableSet headSet(E toElement) { return headSet(toElement, false); } + @Override public NavigableSet tailSet(E fromElement) { return tailSet(fromElement, true); } + @Override public NavigableSet descendingSet() { return new KeySet(m.descendingMap()); } @SuppressWarnings("unchecked") + @Override public Spliterator spliterator() { if (m instanceof PersistentSkipListMap) return ((PersistentSkipListMap)m).keySpliterator(); @@ -1487,27 +1525,35 @@ static final class Values extends AbstractCollection m = map; } @SuppressWarnings("unchecked") + @Override public Iterator iterator() { if (m instanceof PersistentSkipListMap) return ((PersistentSkipListMap)m).valueIterator(); else return ((SubMap)m).valueIterator(); } + @Override public boolean isEmpty() { return m.isEmpty(); } + @Override public int size() { return m.size(); } + @Override public boolean contains(Object o) { return m.containsValue(o); } + @Override public void clear() { m.clear(); } + @Override public Object[] toArray() { return toList(this).toArray(); } + @Override public T[] toArray(T[] a) { return toList(this).toArray(a); } @SuppressWarnings("unchecked") + @Override public Spliterator spliterator() { if (m instanceof PersistentSkipListMap) return ((PersistentSkipListMap)m).valueSpliterator(); @@ -1516,42 +1562,49 @@ public Spliterator spliterator() { } } - static final class EntrySet extends AbstractSet> { + static final class EntrySet extends AbstractSet> { final ConcurrentNavigableMap m; EntrySet(ConcurrentNavigableMap map) { m = map; } @SuppressWarnings("unchecked") - public Iterator> iterator() { + @Override + public Iterator> iterator() { if (m instanceof PersistentSkipListMap) return ((PersistentSkipListMap)m).entryIterator(); else return ((SubMap)m).entryIterator(); } + @Override public boolean contains(Object o) { if (!(o instanceof Map.Entry)) return false; - Map.Entry e = (Map.Entry)o; + Entry e = (Entry)o; V1 v = m.get(e.getKey()); return v != null && v.equals(e.getValue()); } + @Override public boolean remove(Object o) { if (!(o instanceof Map.Entry)) return false; - Map.Entry e = (Map.Entry)o; + Entry e = (Entry)o; return m.remove(e.getKey(), e.getValue()); } + @Override public boolean isEmpty() { return m.isEmpty(); } + @Override public int size() { return m.size(); } + @Override public void clear() { m.clear(); } + @Override public boolean equals(Object o) { if (o == this) return true; @@ -1566,14 +1619,21 @@ public boolean equals(Object o) { return false; } } + @Override + public int hashCode() { + return m.hashCode(); + } + @Override public Object[] toArray() { return toList(this).toArray(); } + @Override public T[] toArray(T[] a) { return toList(this).toArray(a); } @SuppressWarnings("unchecked") - public Spliterator> spliterator() { + @Override + public Spliterator> spliterator() { if (m instanceof PersistentSkipListMap) return ((PersistentSkipListMap)m).entrySpliterator(); else - return (Spliterator>) + return (Spliterator>) ((SubMap)m).entryIterator(); } } @@ -1596,7 +1656,7 @@ static final class SubMap // Lazily initialized view holders private transient KeySet keySetView; - private transient Set> entrySetView; + private transient Set> entrySetView; private transient Collection valuesView; SubMap(PersistentSkipListMap map, @@ -1638,7 +1698,7 @@ void checkKeyBounds(K key, Comparator cmp) { throw new IllegalArgumentException("key out of range"); } - boolean isBeforeEnd(PersistentSkipListMap.Node n, + boolean isBeforeEnd(Node n, Comparator cmp) { if (n == null) return false; @@ -1653,7 +1713,7 @@ boolean isBeforeEnd(PersistentSkipListMap.Node n, return true; } - PersistentSkipListMap.Node loNode(Comparator cmp) { + Node loNode(Comparator cmp) { if (lo == null) return m.findFirst(); else if (loInclusive) @@ -1662,7 +1722,7 @@ else if (loInclusive) return m.findNear(lo, GT, cmp); } - PersistentSkipListMap.Node hiNode(Comparator cmp) { + Node hiNode(Comparator cmp) { if (hi == null) return m.findLast(); else if (hiInclusive) @@ -1673,7 +1733,7 @@ else if (hiInclusive) K lowestKey() { Comparator cmp = m.comparator; - PersistentSkipListMap.Node n = loNode(cmp); + Node n = loNode(cmp); if (isBeforeEnd(n, cmp)) return n.key(); else @@ -1682,7 +1742,7 @@ K lowestKey() { K highestKey() { Comparator cmp = m.comparator; - PersistentSkipListMap.Node n = hiNode(cmp); + Node n = hiNode(cmp); if (n != null) { K last = n.key(); if (inBounds(last, cmp)) @@ -1691,31 +1751,31 @@ K highestKey() { throw new NoSuchElementException(); } - Map.Entry lowestEntry() { + Entry lowestEntry() { Comparator cmp = m.comparator; for (;;) { - PersistentSkipListMap.Node n = loNode(cmp); + Node n = loNode(cmp); if (!isBeforeEnd(n, cmp)) return null; - Map.Entry e = n.createSnapshot(); + Entry e = n.createSnapshot(); if (e != null) return e; } } - Map.Entry highestEntry() { + Entry highestEntry() { Comparator cmp = m.comparator; for (;;) { - PersistentSkipListMap.Node n = hiNode(cmp); + Node n = hiNode(cmp); if (n == null || !inBounds(n.key(), cmp)) return null; - Map.Entry e = n.createSnapshot(); + Entry e = n.createSnapshot(); if (e != null) return e; } } - Map.Entry removeLowest() { + Entry removeLowest() { Comparator cmp = m.comparator; for (;;) { Node n = loNode(cmp); @@ -1726,11 +1786,11 @@ Map.Entry removeLowest() { return null; V v = m.doRemove(k, null); if (v != null) - return new AbstractMap.SimpleImmutableEntry(k, v); + return new SimpleImmutableEntry(k, v); } } - Map.Entry removeHighest() { + Entry removeHighest() { Comparator cmp = m.comparator; for (;;) { Node n = hiNode(cmp); @@ -1741,11 +1801,11 @@ Map.Entry removeHighest() { return null; V v = m.doRemove(k, null); if (v != null) - return new AbstractMap.SimpleImmutableEntry(k, v); + return new SimpleImmutableEntry(k, v); } } - Map.Entry getNearEntry(K key, int rel) { + Entry getNearEntry(K key, int rel) { Comparator cmp = m.comparator; if (isDescending) { // adjust relation for direction if ((rel & LT) == 0) @@ -1764,7 +1824,7 @@ Map.Entry getNearEntry(K key, int rel) { K k = n.key(); V v = n.getValidValue(); if (v != null) - return new AbstractMap.SimpleImmutableEntry(k, v); + return new SimpleImmutableEntry(k, v); } } @@ -1778,7 +1838,7 @@ K getNearKey(K key, int rel) { } if (tooLow(key, cmp)) { if ((rel & LT) == 0) { - PersistentSkipListMap.Node n = loNode(cmp); + Node n = loNode(cmp); if (isBeforeEnd(n, cmp)) return n.key(); } @@ -1786,7 +1846,7 @@ K getNearKey(K key, int rel) { } if (tooHigh(key, cmp)) { if ((rel & LT) != 0) { - PersistentSkipListMap.Node n = hiNode(cmp); + Node n = hiNode(cmp); if (n != null) { K last = n.key(); if (inBounds(last, cmp)) @@ -1816,6 +1876,7 @@ public V get(PersistentObject key) { return (!inBounds(key, m.comparator)) ? null : m.get(key); } + @Override public V put(K key, V value) { checkKeyBounds(key, m.comparator); return m.put(key, value); @@ -1825,10 +1886,11 @@ public V remove(PersistentObject key) { return (!inBounds(key, m.comparator)) ? null : m.remove(key); } + @Override public int size() { Comparator cmp = m.comparator; long count = 0; - for (PersistentSkipListMap.Node n = loNode(cmp); + for (Node n = loNode(cmp); isBeforeEnd(n, cmp); n = n.next()) { if (n.getValidValue() != null) @@ -1837,16 +1899,18 @@ public int size() { return count >= Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)count; } + @Override public boolean isEmpty() { Comparator cmp = m.comparator; return !isBeforeEnd(loNode(cmp), cmp); } + @Override public boolean containsValue(Object value) { if (value == null) throw new NullPointerException(); Comparator cmp = m.comparator; - for (PersistentSkipListMap.Node n = loNode(cmp); + for (Node n = loNode(cmp); isBeforeEnd(n, cmp); n = n.next()) { V v = n.getValidValue(); @@ -1856,9 +1920,10 @@ public boolean containsValue(Object value) { return false; } + @Override public void clear() { Comparator cmp = m.comparator; - for (PersistentSkipListMap.Node n = loNode(cmp); + for (Node n = loNode(cmp); isBeforeEnd(n, cmp); n = n.next()) { if (n.getValidValue() != null) @@ -1866,26 +1931,31 @@ public void clear() { } } + @Override public V putIfAbsent(K key, V value) { checkKeyBounds(key, m.comparator); return m.putIfAbsent(key, value); } @SuppressWarnings("unchecked") + @Override public boolean remove(Object key, Object value) { return inBounds((K)key, m.comparator) && m.remove((K)key, (V)value); } + @Override public boolean replace(K key, V oldValue, V newValue) { checkKeyBounds(key, m.comparator); return m.replace(key, oldValue, newValue); } + @Override public V replace(K key, V value) { checkKeyBounds(key, m.comparator); return m.replace(key, value); } + @Override public Comparator comparator() { Comparator cmp = m.comparator(); if (isDescending) @@ -1967,7 +2037,7 @@ public SubMap descendingMap() { hi, hiInclusive, !isDescending); } - public Map.Entry ceilingEntry(K key) { + public Entry ceilingEntry(K key) { return getNearEntry(key, GT|EQ); } @@ -1975,7 +2045,7 @@ public K ceilingKey(K key) { return getNearKey(key, GT|EQ); } - public Map.Entry lowerEntry(K key) { + public Entry lowerEntry(K key) { return getNearEntry(key, LT); } @@ -1983,7 +2053,7 @@ public K lowerKey(K key) { return getNearKey(key, LT); } - public Map.Entry floorEntry(K key) { + public Entry floorEntry(K key) { return getNearEntry(key, LT|EQ); } @@ -1991,7 +2061,7 @@ public K floorKey(K key) { return getNearKey(key, LT|EQ); } - public Map.Entry higherEntry(K key) { + public Entry higherEntry(K key) { return getNearEntry(key, GT); } @@ -2007,22 +2077,23 @@ public K lastKey() { return isDescending ? lowestKey() : highestKey(); } - public Map.Entry firstEntry() { + public Entry firstEntry() { return isDescending ? highestEntry() : lowestEntry(); } - public Map.Entry lastEntry() { + public Entry lastEntry() { return isDescending ? lowestEntry() : highestEntry(); } - public Map.Entry pollFirstEntry() { + public Entry pollFirstEntry() { return isDescending ? removeHighest() : removeLowest(); } - public Map.Entry pollLastEntry() { + public Entry pollLastEntry() { return isDescending ? removeLowest() : removeHighest(); } + @Override public NavigableSet keySet() { KeySet ks = keySetView; return (ks != null) ? ks : (keySetView = new KeySet(this)); @@ -2033,16 +2104,19 @@ public NavigableSet navigableKeySet() { return (ks != null) ? ks : (keySetView = new KeySet(this)); } + @Override public Collection values() { Collection vs = valuesView; return (vs != null) ? vs : (valuesView = new Values(this)); } - public Set> entrySet() { - Set> es = entrySetView; + @Override + public Set> entrySet() { + Set> es = entrySetView; return (es != null) ? es : (entrySetView = new EntrySet(this)); } + @Override public NavigableSet descendingKeySet() { return descendingMap().navigableKeySet(); } @@ -2055,7 +2129,7 @@ Iterator valueIterator() { return new SubMapValueIterator(); } - Iterator> entryIterator() { + Iterator> entryIterator() { return new SubMapEntryIterator(); } @@ -2086,6 +2160,7 @@ abstract class SubMapIter implements Iterator, Spliterator { } } + @Override public final boolean hasNext() { return next != null; } @@ -2138,6 +2213,7 @@ private void descend() { } } + @Override public void remove() { Node l = lastReturned; if (l == null) @@ -2146,10 +2222,12 @@ public void remove() { lastReturned = null; } + @Override public Spliterator trySplit() { return null; } + @Override public boolean tryAdvance(Consumer action) { if (hasNext()) { action.accept(next()); @@ -2158,11 +2236,13 @@ public boolean tryAdvance(Consumer action) { return false; } + @Override public void forEachRemaining(Consumer action) { while (hasNext()) action.accept(next()); } + @Override public long estimateSize() { return Long.MAX_VALUE; } @@ -2170,38 +2250,45 @@ public long estimateSize() { } final class SubMapValueIterator extends SubMapIter { + @Override public V next() { V v = nextValue; advance(); return v; } + @Override public int characteristics() { return 0; } } final class SubMapKeyIterator extends SubMapIter { + @Override public K next() { Node n = next; advance(); return n.key(); } + @Override public int characteristics() { return Spliterator.DISTINCT | Spliterator.ORDERED | Spliterator.SORTED; } + @Override public final Comparator getComparator() { return SubMap.this.comparator(); } } - final class SubMapEntryIterator extends SubMapIter> { - public Map.Entry next() { + final class SubMapEntryIterator extends SubMapIter> { + @Override + public Entry next() { Node n = next; V v = nextValue; advance(); - return new AbstractMap.SimpleImmutableEntry(n.key(), v); + return new SimpleImmutableEntry(n.key(), v); } + @Override public int characteristics() { return Spliterator.DISTINCT; } @@ -2217,6 +2304,7 @@ public void forEach(BiConsumer action) { } } + @Override public void replaceAll(BiFunction function) { if (function == null) throw new NullPointerException(); V v; @@ -2420,13 +2508,13 @@ final ValueSpliterator valueSpliterator() { } static final class EntrySpliterator extends CSLMSpliterator - implements Spliterator> { + implements Spliterator> { EntrySpliterator(Comparator comparator, Index row, Node origin, K fence, int est) { super(comparator, row, origin, fence, est); } - public Spliterator> trySplit() { + public Spliterator> trySplit() { Node e; K ek; Comparator cmp = comparator; K f = fence; @@ -2448,7 +2536,7 @@ public Spliterator> trySplit() { return null; } - public void forEachRemaining(Consumer> action) { + public void forEachRemaining(Consumer> action) { if (action == null) throw new NullPointerException(); Comparator cmp = comparator; K f = fence; @@ -2466,7 +2554,7 @@ public void forEachRemaining(Consumer> action) { } } - public boolean tryAdvance(Consumer> action) { + public boolean tryAdvance(Consumer> action) { if (action == null) throw new NullPointerException(); Comparator cmp = comparator; K f = fence; @@ -2495,13 +2583,13 @@ public int characteristics() { Spliterator.NONNULL; } - public final Comparator> getComparator() { + public final Comparator> getComparator() { // Adapt or create a key-based comparator if (comparator != null) { - return Map.Entry.comparingByKey(comparator); + return Entry.comparingByKey(comparator); } else { - return (Comparator>) (e1, e2) -> { + return (Comparator>) (e1, e2) -> { @SuppressWarnings("unchecked") Comparable k1 = (Comparable) e1.getKey(); return k1.compareTo(e2.getKey()); diff --git a/src/main/java/lib/util/persistent/PersistentTuple1.java b/src/main/java/lib/util/persistent/PersistentTuple1.java index 22a38f8..81c7eab 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple1.java +++ b/src/main/java/lib/util/persistent/PersistentTuple1.java @@ -19,16 +19,18 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple1 extends PersistentObject { - private static final ObjectField FIELD1 = new ObjectField<>(); +@PersistentClass +public class PersistentTuple1 + extends PersistentObject { + private static final long serialVersionUID = 1L; + private static final ObjectField FIELD1 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple1.class, FIELD1); public PersistentTuple1() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple10.java b/src/main/java/lib/util/persistent/PersistentTuple10.java index da30da8..35e2f33 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple10.java +++ b/src/main/java/lib/util/persistent/PersistentTuple10.java @@ -19,15 +19,17 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple10 extends PersistentObject { +@PersistentClass +public class PersistentTuple10 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); @@ -37,7 +39,7 @@ public class PersistentTuple10 FIELD7 = new ObjectField<>(); private static final ObjectField FIELD8 = new ObjectField<>(); private static final ObjectField FIELD9 = new ObjectField<>(); - private static final ObjectField FIELD10 = new ObjectField<>(); + private static final ObjectField FIELD10 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple10.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7, FIELD8, FIELD9, FIELD10); public PersistentTuple10() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple11.java b/src/main/java/lib/util/persistent/PersistentTuple11.java index d66ef8a..fd1781f 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple11.java +++ b/src/main/java/lib/util/persistent/PersistentTuple11.java @@ -19,15 +19,17 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple11 extends PersistentObject { +@PersistentClass +public class PersistentTuple11 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); @@ -38,7 +40,7 @@ public class PersistentTuple11 FIELD8 = new ObjectField<>(); private static final ObjectField FIELD9 = new ObjectField<>(); private static final ObjectField FIELD10 = new ObjectField<>(); - private static final ObjectField FIELD11 = new ObjectField<>(); + private static final ObjectField FIELD11 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple11.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7, FIELD8, FIELD9, FIELD10, FIELD11); public PersistentTuple11() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple12.java b/src/main/java/lib/util/persistent/PersistentTuple12.java index 00af1ca..ca756a1 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple12.java +++ b/src/main/java/lib/util/persistent/PersistentTuple12.java @@ -19,15 +19,17 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple12 extends PersistentObject { +@PersistentClass +public class PersistentTuple12 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); @@ -39,7 +41,7 @@ public class PersistentTuple12 FIELD9 = new ObjectField<>(); private static final ObjectField FIELD10 = new ObjectField<>(); private static final ObjectField FIELD11 = new ObjectField<>(); - private static final ObjectField FIELD12 = new ObjectField<>(); + private static final ObjectField FIELD12 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple12.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7, FIELD8, FIELD9, FIELD10, FIELD11, FIELD12); public PersistentTuple12() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple13.java b/src/main/java/lib/util/persistent/PersistentTuple13.java index cd0e5ed..b41b5cf 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple13.java +++ b/src/main/java/lib/util/persistent/PersistentTuple13.java @@ -19,15 +19,17 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple13 extends PersistentObject { +@PersistentClass +public class PersistentTuple13 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); @@ -40,7 +42,7 @@ public class PersistentTuple13 FIELD10 = new ObjectField<>(); private static final ObjectField FIELD11 = new ObjectField<>(); private static final ObjectField FIELD12 = new ObjectField<>(); - private static final ObjectField FIELD13 = new ObjectField<>(); + private static final ObjectField FIELD13 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple13.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7, FIELD8, FIELD9, FIELD10, FIELD11, FIELD12, FIELD13); public PersistentTuple13() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple14.java b/src/main/java/lib/util/persistent/PersistentTuple14.java index adf94c3..853b230 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple14.java +++ b/src/main/java/lib/util/persistent/PersistentTuple14.java @@ -19,15 +19,17 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple14 extends PersistentObject { +@PersistentClass +public class PersistentTuple14 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); @@ -41,7 +43,7 @@ public class PersistentTuple14 FIELD11 = new ObjectField<>(); private static final ObjectField FIELD12 = new ObjectField<>(); private static final ObjectField FIELD13 = new ObjectField<>(); - private static final ObjectField FIELD14 = new ObjectField<>(); + private static final ObjectField FIELD14 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple14.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7, FIELD8, FIELD9, FIELD10, FIELD11, FIELD12, FIELD13, FIELD14); public PersistentTuple14() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple15.java b/src/main/java/lib/util/persistent/PersistentTuple15.java index 197aeb7..deddc31 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple15.java +++ b/src/main/java/lib/util/persistent/PersistentTuple15.java @@ -19,15 +19,17 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple15 extends PersistentObject { +@PersistentClass +public class PersistentTuple15 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); @@ -42,7 +44,7 @@ public class PersistentTuple15 FIELD12 = new ObjectField<>(); private static final ObjectField FIELD13 = new ObjectField<>(); private static final ObjectField FIELD14 = new ObjectField<>(); - private static final ObjectField FIELD15 = new ObjectField<>(); + private static final ObjectField FIELD15 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple15.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7, FIELD8, FIELD9, FIELD10, FIELD11, FIELD12, FIELD13, FIELD14, FIELD15); public PersistentTuple15() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple16.java b/src/main/java/lib/util/persistent/PersistentTuple16.java index 2f598e0..22e82bd 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple16.java +++ b/src/main/java/lib/util/persistent/PersistentTuple16.java @@ -19,15 +19,17 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple16 extends PersistentObject { +@PersistentClass +public class PersistentTuple16 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); @@ -43,7 +45,7 @@ public class PersistentTuple16 FIELD13 = new ObjectField<>(); private static final ObjectField FIELD14 = new ObjectField<>(); private static final ObjectField FIELD15 = new ObjectField<>(); - private static final ObjectField FIELD16 = new ObjectField<>(); + private static final ObjectField FIELD16 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple16.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7, FIELD8, FIELD9, FIELD10, FIELD11, FIELD12, FIELD13, FIELD14, FIELD15, FIELD16); public PersistentTuple16() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple17.java b/src/main/java/lib/util/persistent/PersistentTuple17.java index 56619ea..3761a5f 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple17.java +++ b/src/main/java/lib/util/persistent/PersistentTuple17.java @@ -19,15 +19,17 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple17 extends PersistentObject { +@PersistentClass +public class PersistentTuple17 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); @@ -44,7 +46,7 @@ public class PersistentTuple17 FIELD14 = new ObjectField<>(); private static final ObjectField FIELD15 = new ObjectField<>(); private static final ObjectField FIELD16 = new ObjectField<>(); - private static final ObjectField FIELD17 = new ObjectField<>(); + private static final ObjectField FIELD17 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple17.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7, FIELD8, FIELD9, FIELD10, FIELD11, FIELD12, FIELD13, FIELD14, FIELD15, FIELD16, FIELD17); public PersistentTuple17() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple18.java b/src/main/java/lib/util/persistent/PersistentTuple18.java index 9882bf7..a09e0bd 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple18.java +++ b/src/main/java/lib/util/persistent/PersistentTuple18.java @@ -19,15 +19,17 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple18 extends PersistentObject { +@PersistentClass +public class PersistentTuple18 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); @@ -45,7 +47,7 @@ public class PersistentTuple18 FIELD15 = new ObjectField<>(); private static final ObjectField FIELD16 = new ObjectField<>(); private static final ObjectField FIELD17 = new ObjectField<>(); - private static final ObjectField FIELD18 = new ObjectField<>(); + private static final ObjectField FIELD18 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple18.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7, FIELD8, FIELD9, FIELD10, FIELD11, FIELD12, FIELD13, FIELD14, FIELD15, FIELD16, FIELD17, FIELD18); public PersistentTuple18() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple19.java b/src/main/java/lib/util/persistent/PersistentTuple19.java index c4e7b5d..26dda83 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple19.java +++ b/src/main/java/lib/util/persistent/PersistentTuple19.java @@ -19,15 +19,17 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple19 extends PersistentObject { +@PersistentClass +public class PersistentTuple19 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); @@ -46,7 +48,7 @@ public class PersistentTuple19 FIELD16 = new ObjectField<>(); private static final ObjectField FIELD17 = new ObjectField<>(); private static final ObjectField FIELD18 = new ObjectField<>(); - private static final ObjectField FIELD19 = new ObjectField<>(); + private static final ObjectField FIELD19 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple19.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7, FIELD8, FIELD9, FIELD10, FIELD11, FIELD12, FIELD13, FIELD14, FIELD15, FIELD16, FIELD17, FIELD18, FIELD19); public PersistentTuple19() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple2.java b/src/main/java/lib/util/persistent/PersistentTuple2.java index 631b142..f176b80 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple2.java +++ b/src/main/java/lib/util/persistent/PersistentTuple2.java @@ -19,17 +19,19 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple2 extends PersistentObject { +@PersistentClass +public class PersistentTuple2 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); - private static final ObjectField FIELD2 = new ObjectField<>(); + private static final ObjectField FIELD2 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple2.class, FIELD1, FIELD2); public PersistentTuple2() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple20.java b/src/main/java/lib/util/persistent/PersistentTuple20.java index 03870db..5853919 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple20.java +++ b/src/main/java/lib/util/persistent/PersistentTuple20.java @@ -19,15 +19,17 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple20 extends PersistentObject { +@PersistentClass +public class PersistentTuple20 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); @@ -47,7 +49,7 @@ public class PersistentTuple20 FIELD17 = new ObjectField<>(); private static final ObjectField FIELD18 = new ObjectField<>(); private static final ObjectField FIELD19 = new ObjectField<>(); - private static final ObjectField FIELD20 = new ObjectField<>(); + private static final ObjectField FIELD20 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple20.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7, FIELD8, FIELD9, FIELD10, FIELD11, FIELD12, FIELD13, FIELD14, FIELD15, FIELD16, FIELD17, FIELD18, FIELD19, FIELD20); public PersistentTuple20() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple21.java b/src/main/java/lib/util/persistent/PersistentTuple21.java index f112c89..a78ef0b 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple21.java +++ b/src/main/java/lib/util/persistent/PersistentTuple21.java @@ -19,15 +19,17 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple21 extends PersistentObject { +@PersistentClass +public class PersistentTuple21 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); @@ -48,7 +50,7 @@ public class PersistentTuple21 FIELD18 = new ObjectField<>(); private static final ObjectField FIELD19 = new ObjectField<>(); private static final ObjectField FIELD20 = new ObjectField<>(); - private static final ObjectField FIELD21 = new ObjectField<>(); + private static final ObjectField FIELD21 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple21.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7, FIELD8, FIELD9, FIELD10, FIELD11, FIELD12, FIELD13, FIELD14, FIELD15, FIELD16, FIELD17, FIELD18, FIELD19, FIELD20, FIELD21); public PersistentTuple21() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple22.java b/src/main/java/lib/util/persistent/PersistentTuple22.java index d0805fb..38c0569 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple22.java +++ b/src/main/java/lib/util/persistent/PersistentTuple22.java @@ -19,15 +19,17 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple22 extends PersistentObject { +@PersistentClass +public class PersistentTuple22 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); @@ -49,7 +51,7 @@ public class PersistentTuple22 FIELD19 = new ObjectField<>(); private static final ObjectField FIELD20 = new ObjectField<>(); private static final ObjectField FIELD21 = new ObjectField<>(); - private static final ObjectField FIELD22 = new ObjectField<>(); + private static final ObjectField FIELD22 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple22.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7, FIELD8, FIELD9, FIELD10, FIELD11, FIELD12, FIELD13, FIELD14, FIELD15, FIELD16, FIELD17, FIELD18, FIELD19, FIELD20, FIELD21, FIELD22); public PersistentTuple22() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple3.java b/src/main/java/lib/util/persistent/PersistentTuple3.java index fabba3e..c0b2242 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple3.java +++ b/src/main/java/lib/util/persistent/PersistentTuple3.java @@ -19,18 +19,20 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple3 extends PersistentObject { +@PersistentClass +public class PersistentTuple3 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); - private static final ObjectField FIELD3 = new ObjectField<>(); + private static final ObjectField FIELD3 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple3.class, FIELD1, FIELD2, FIELD3); public PersistentTuple3() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple4.java b/src/main/java/lib/util/persistent/PersistentTuple4.java index b5cf46c..dc9b0d3 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple4.java +++ b/src/main/java/lib/util/persistent/PersistentTuple4.java @@ -19,19 +19,21 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple4 extends PersistentObject { +@PersistentClass +public class PersistentTuple4 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); - private static final ObjectField FIELD4 = new ObjectField<>(); + private static final ObjectField FIELD4 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple4.class, FIELD1, FIELD2, FIELD3, FIELD4); public PersistentTuple4() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple5.java b/src/main/java/lib/util/persistent/PersistentTuple5.java index 2ca4dfd..9b9e78f 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple5.java +++ b/src/main/java/lib/util/persistent/PersistentTuple5.java @@ -19,20 +19,22 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple5 extends PersistentObject { +@PersistentClass +public class PersistentTuple5 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); private static final ObjectField FIELD4 = new ObjectField<>(); - private static final ObjectField FIELD5 = new ObjectField<>(); + private static final ObjectField FIELD5 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple5.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5); public PersistentTuple5() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple6.java b/src/main/java/lib/util/persistent/PersistentTuple6.java index 1c5a359..b6fe2f8 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple6.java +++ b/src/main/java/lib/util/persistent/PersistentTuple6.java @@ -19,21 +19,23 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple6 extends PersistentObject { +@PersistentClass +public class PersistentTuple6 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); private static final ObjectField FIELD4 = new ObjectField<>(); private static final ObjectField FIELD5 = new ObjectField<>(); - private static final ObjectField FIELD6 = new ObjectField<>(); + private static final ObjectField FIELD6 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple6.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6); public PersistentTuple6() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple7.java b/src/main/java/lib/util/persistent/PersistentTuple7.java index 4035a97..e0916ba 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple7.java +++ b/src/main/java/lib/util/persistent/PersistentTuple7.java @@ -19,22 +19,24 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple7 extends PersistentObject { +@PersistentClass +public class PersistentTuple7 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); private static final ObjectField FIELD4 = new ObjectField<>(); private static final ObjectField FIELD5 = new ObjectField<>(); private static final ObjectField FIELD6 = new ObjectField<>(); - private static final ObjectField FIELD7 = new ObjectField<>(); + private static final ObjectField FIELD7 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple7.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7); public PersistentTuple7() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple8.java b/src/main/java/lib/util/persistent/PersistentTuple8.java index b05a43c..8e0614c 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple8.java +++ b/src/main/java/lib/util/persistent/PersistentTuple8.java @@ -19,15 +19,17 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple8 extends PersistentObject { +@PersistentClass +public class PersistentTuple8 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); @@ -35,7 +37,7 @@ public class PersistentTuple8 FIELD5 = new ObjectField<>(); private static final ObjectField FIELD6 = new ObjectField<>(); private static final ObjectField FIELD7 = new ObjectField<>(); - private static final ObjectField FIELD8 = new ObjectField<>(); + private static final ObjectField FIELD8 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple8.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7, FIELD8); public PersistentTuple8() { diff --git a/src/main/java/lib/util/persistent/PersistentTuple9.java b/src/main/java/lib/util/persistent/PersistentTuple9.java index faa983b..530b736 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple9.java +++ b/src/main/java/lib/util/persistent/PersistentTuple9.java @@ -19,15 +19,17 @@ * Boston, MA 02110-1301, USA. */ - - package lib.util.persistent; import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; +import lib.util.persistent.front.PersistentClass; -public class PersistentTuple9 extends PersistentObject { +@PersistentClass +public class PersistentTuple9 + extends PersistentObject { + private static final long serialVersionUID = 1L; private static final ObjectField FIELD1 = new ObjectField<>(); private static final ObjectField FIELD2 = new ObjectField<>(); private static final ObjectField FIELD3 = new ObjectField<>(); @@ -36,7 +38,7 @@ public class PersistentTuple9 FIELD6 = new ObjectField<>(); private static final ObjectField FIELD7 = new ObjectField<>(); private static final ObjectField FIELD8 = new ObjectField<>(); - private static final ObjectField FIELD9 = new ObjectField<>(); + private static final ObjectField FIELD9 = new ObjectField<>(); public static final ObjectType TYPE = ObjectType.fromFields(PersistentTuple9.class, FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7, FIELD8, FIELD9); public PersistentTuple9() { diff --git a/src/main/java/lib/util/persistent/PersistentValue.java b/src/main/java/lib/util/persistent/PersistentValue.java index 1e41041..9d3443f 100644 --- a/src/main/java/lib/util/persistent/PersistentValue.java +++ b/src/main/java/lib/util/persistent/PersistentValue.java @@ -36,6 +36,7 @@ // TODO: factor common accessor code out of PersistentValue and PersistentObject public abstract class PersistentValue implements Persistent { + // FIXME: Compatible only with the default provider private static final PersistentHeap heap = PersistentMemoryProvider.getDefaultProvider().getHeap(); private final ValuePointer pointer; diff --git a/src/main/java/lib/util/persistent/PhantomQueue.java b/src/main/java/lib/util/persistent/PhantomQueue.java index 546cbff..6638420 100644 --- a/src/main/java/lib/util/persistent/PhantomQueue.java +++ b/src/main/java/lib/util/persistent/PhantomQueue.java @@ -25,6 +25,7 @@ import java.util.*; import java.util.concurrent.*; +// PPR: memory leak if crash before purge the reference ? class PhantomQueue { private Listener listener; private ReferenceQueue queue; diff --git a/src/main/java/lib/util/persistent/RawString.java b/src/main/java/lib/util/persistent/RawString.java index 9bfbe2e..6e7329a 100644 --- a/src/main/java/lib/util/persistent/RawString.java +++ b/src/main/java/lib/util/persistent/RawString.java @@ -33,11 +33,12 @@ public RawString(String s) { this.string = s; final Box box = new Box<>(); Transaction.run(() -> { + // FIXME: Compatible only with the default provider MemoryRegion r = box.set(PersistentMemoryProvider.getDefaultProvider().getHeap().allocateRegion(Types.INT.getSize() + s.length())); putString(r, 0, s); }); this.region = box.get(); - // trace(region.addr(), "created RawString"); + trace(region.addr(), "created RawString"); } public RawString(MemoryRegion region) { @@ -56,9 +57,7 @@ public String toString() { private String getString(long offset) { int size = region.getInt(offset); if (size < 0 || size > 128) { - System.out.format("Heap appears to be corrupt: RawString at address %d size = %d\n", region.addr() + offset, size); - new Exception().printStackTrace(); - System.exit(-1); + throw new HeapCorruptedError("Heap appears to be corrupt: RawString at address "+region.addr() + offset+ " size = "+size); } byte[] bytes = new byte[size]; long base = offset + Types.INT.getSize(); diff --git a/src/main/java/lib/util/persistent/Stats.java b/src/main/java/lib/util/persistent/Stats.java index 9191516..fd6c6a5 100644 --- a/src/main/java/lib/util/persistent/Stats.java +++ b/src/main/java/lib/util/persistent/Stats.java @@ -20,7 +20,6 @@ */ package lib.util.persistent; -import lib.xpersistent.XTransaction; public class Stats { static boolean enable = false; diff --git a/src/main/java/lib/util/persistent/Transaction.java b/src/main/java/lib/util/persistent/Transaction.java index bf27da8..3d057ff 100644 --- a/src/main/java/lib/util/persistent/Transaction.java +++ b/src/main/java/lib/util/persistent/Transaction.java @@ -28,13 +28,13 @@ import lib.xpersistent.XTransaction; public interface Transaction extends AutoCloseable { - public interface Update { + interface Update { public void run(); } - public enum State {None, Initializing, Active, Committed, Aborted} + enum State {None, Initializing, Active, Committed, Aborted} - public static void run(PersistentMemoryProvider provider, Update update, PersistentObject... toLock) { + static void run(PersistentMemoryProvider provider, Update update, PersistentObject... toLock) { boolean success = false; int attempts = 1; int MAX_ATTEMPTS = 25; @@ -53,9 +53,9 @@ public static void run(PersistentMemoryProvider provider, Update update, Persist success = true; } catch (Throwable e) { - // trace("Transaction.run() caught %s, depth = %d", e, XTransaction.depth.get()); + trace("Transaction.run() caught %s, depth = %d", e, XTransaction.depth.get()); t.abort(); - // trace("called abort on %s", t); + trace("called abort on %s", t); if (XTransaction.depth.get() != 1) throw e; // unwind stack else if (!(e instanceof TransactionRetryException)) throw e; // not a retry-able exception // retry @@ -66,7 +66,7 @@ public static void run(PersistentMemoryProvider provider, Update update, Persist attempts++; if (!success) { // Stats.transactions.retries++; - // trace(true, "retry #%d", attempts - 1); + trace(true, "retry #%d", attempts - 1); try {Thread.sleep(attempts);} catch(InterruptedException ie) {ie.printStackTrace();} } } @@ -75,19 +75,24 @@ public static void run(PersistentMemoryProvider provider, Update update, Persist } } - public static void run(Update update, PersistentObject... toLock) { + static void run(Update update, PersistentObject... toLock) { + // FIXME: Compatible only with the default provider run(PersistentMemoryProvider.getDefaultProvider(), update, toLock); } - public static Transaction newInstance() { + static Transaction newInstance() { + // FIXME: Compatible only with the default provider return PersistentMemoryProvider.getDefaultProvider().newTransaction(); } + static Transaction newInstance(PersistentMemoryProvider provider) { + return provider.newTransaction(); + } - public Transaction update(Update update); - public Transaction start(PersistentObject... toLock); - public void commit(); - public void abort(); - public State state(); + Transaction update(Update update); + Transaction start(PersistentObject... toLock); + void commit(); + void abort(); + State state(); default void close() {commit();} } diff --git a/src/main/java/lib/util/persistent/types/ArrayType.java b/src/main/java/lib/util/persistent/types/ArrayType.java index 903b3df..9fa216c 100644 --- a/src/main/java/lib/util/persistent/types/ArrayType.java +++ b/src/main/java/lib/util/persistent/types/ArrayType.java @@ -36,19 +36,19 @@ public ArrayType(Class cls, PersistentType elementType) { this.elementSize = elementType.getSize(); } - public PersistentType getElementType() { + public final PersistentType getElementType() { return elementType; } - public long getAllocationSize(int count) { + public final long getAllocationSize(int count) { return ELEMENTS_OFFSET + count * elementSize; } - public long getElementOffset(int index) { + public final long getElementOffset(int index) { return ELEMENTS_OFFSET + index * elementSize; } - public long getElementOffset(int index, long size) { + public final long getElementOffset(int index, long size) { return ELEMENTS_OFFSET + index * size; } diff --git a/src/main/java/lib/util/persistent/types/Types.java b/src/main/java/lib/util/persistent/types/Types.java index 81c7b16..f0f0c22 100644 --- a/src/main/java/lib/util/persistent/types/Types.java +++ b/src/main/java/lib/util/persistent/types/Types.java @@ -25,6 +25,7 @@ import lib.util.persistent.PersistentValue; import lib.util.persistent.Persistent; import java.lang.reflect.Field; +import java.util.concurrent.ConcurrentHashMap; public class Types { @@ -41,25 +42,45 @@ public class Types { public static final String TYPE_FIELD_NAME = "TYPE"; public static final String OLD_TYPE_FIELD_NAME = "type"; - + + private static final ConcurrentHashMap,PersistentType> typemap=new ConcurrentHashMap<>(); @SuppressWarnings("unchecked") public static synchronized > PersistentType typeForClass(Class cls) { try { + PersistentType t=typemap.get(cls); + if (t!=null) return t; Field typeField = null; - // TODO: remove inner try and catch when old name gone - try { - typeField = cls.getDeclaredField(TYPE_FIELD_NAME); - } - catch (NoSuchFieldException e) { - typeField = cls.getDeclaredField(OLD_TYPE_FIELD_NAME); + PersistentType type; + for (int i=0;i<3;++i) { + try { + switch (i) { + case 0: // TYPE_FIELD_NAME + case 2: // OLD_TYPE_FIELD_NAME + typeField = cls.getDeclaredField(i==0 ? TYPE_FIELD_NAME : OLD_TYPE_FIELD_NAME); + typeField.setAccessible(true); + type = (PersistentType) typeField.get(null); + //typeField.setAccessible(false); // PPR: No thread safe if interlace two threads + if (type == null) throw new RuntimeException("type field is null in " + cls); + typemap.put(cls,type); + return type; + case 1: // Scala + Class scalaObject = cls.getClassLoader().loadClass(cls.getName() + "$"); + Field moduleField=scalaObject.getDeclaredField("MODULE$"); + Object module = moduleField.get(null); + typeField=scalaObject.getDeclaredField(TYPE_FIELD_NAME); + typeField.setAccessible(true); + type = (PersistentType) typeField.get(module); + //typeField.setAccessible(false); + if (type == null) throw new RuntimeException("type field is null in " + cls); + typemap.put(cls,type); + return type; + } + } catch (NoSuchFieldException e) { // Ignore + } catch (ClassNotFoundException e) { // Ignore + } } - typeField.setAccessible(true); - PersistentType type = (PersistentType)typeField.get(null); - typeField.setAccessible(false); - if (type == null) throw new RuntimeException("type field is null in " + cls); - return type; - } - catch (NoSuchFieldException e) {throw new RuntimeException("no type field in " + cls);} + throw new RuntimeException("no type field in " + cls); + } catch (IllegalAccessException e) {throw new RuntimeException("illegal access on type field in " + cls);} } diff --git a/src/main/java/lib/util/persistent/types/ValueType.java b/src/main/java/lib/util/persistent/types/ValueType.java index 59ac39c..7ca3924 100644 --- a/src/main/java/lib/util/persistent/types/ValueType.java +++ b/src/main/java/lib/util/persistent/types/ValueType.java @@ -88,6 +88,11 @@ public boolean equals(Object obj) { return obj instanceof ValueType && ((ValueType)obj).getTypes().equals(getTypes()); } + @Override + public int hashCode() { + return getTypes().hashCode(); + } + @Override public String toString() { StringBuilder buff = new StringBuilder(); diff --git a/src/main/java/lib/xpersistent/XHeap.java b/src/main/java/lib/xpersistent/XHeap.java index 9549635..d636781 100644 --- a/src/main/java/lib/xpersistent/XHeap.java +++ b/src/main/java/lib/xpersistent/XHeap.java @@ -41,6 +41,7 @@ public class XHeap implements PersistentHeap { private boolean debug; public XHeap() { + // FIXME: Compatible only with the default provider this(PersistentMemoryProvider.getDefaultProvider()); } diff --git a/src/main/java/lib/xpersistent/XTransaction.java b/src/main/java/lib/xpersistent/XTransaction.java index 5295b42..b682284 100644 --- a/src/main/java/lib/xpersistent/XTransaction.java +++ b/src/main/java/lib/xpersistent/XTransaction.java @@ -28,7 +28,7 @@ public class XTransaction implements Transaction { - private static ThreadLocal state = new ThreadLocal<>(); + private static ThreadLocal state = new ThreadLocal<>(); public static ThreadLocal depth = new ThreadLocal<>(); private static ThreadLocal> locked = new ThreadLocal<>(); private static ThreadLocal> constructions = new ThreadLocal<>(); @@ -39,13 +39,13 @@ public class XTransaction implements Transaction { XTransaction() { if (state.get() == null) { - state.set(Transaction.State.None); + state.set(State.None); } if (depth.get() == null) { depth.set(0); } if (depth.get() == 0) { - state.set(Transaction.State.None); + state.set(State.None); } if (locked.get() == null) { locked.set(new ArrayList()); @@ -57,12 +57,12 @@ public class XTransaction implements Transaction { } public static void addNewObject(PersistentObject obj) { - // trace(obj.getPointer().addr(), "addNewObject called"); + trace(obj.getPointer().addr(), "addNewObject called"); constructions.get().add(obj); } - public Transaction update(Transaction.Update update) { - if (state.get() != Transaction.State.Active) { + public Transaction update(Update update) { + if (state.get() != State.Active) { throw new TransactionError("In update: transaction not active"); } update.run(); @@ -70,9 +70,9 @@ public Transaction update(Transaction.Update update) { } private void releaseLocks() { - // trace("releaseLocks called, depth = %d, this = %s", depth.get(), this); + trace("releaseLocks called, depth = %d, this = %s", depth.get(), this); ArrayList toUnlock = locked.get(); - for (int i = toUnlock.size() - 1; i >= 0; i--) { + for (int i = toUnlock.size() - 1; i >= 0; --i) { PersistentObject obj = toUnlock.get(i); obj.monitorExit(); } @@ -80,38 +80,38 @@ private void releaseLocks() { } public Transaction start(PersistentObject... toLock) { - // trace("start transaction, depth = %d, this = %s", depth.get(), this); + trace("start transaction, depth = %d, this = %s", depth.get(), this); ArrayList objs = new ArrayList<>(); ArrayList lockedObjs = new ArrayList<>(); for (PersistentObject obj : toLock) { - if (obj != null) objs.add(obj); + if (obj != null) objs.add(obj); } boolean didLock = PersistentObject.monitorEnter(objs, lockedObjs); if (!didLock) { - // trace("failed to get transaction locks"); + trace("failed to get transaction locks"); // assert(lockedObjs.isEmpty()); - throw new TransactionRetryException("failed to get transaction locks"); + throw new TransactionRetryException("Failed to get transaction locks"); } locked.get().addAll(lockedObjs); - if (depth.get() == 1 && state.get() == Transaction.State.None) { - state.set(Transaction.State.Active); + if (depth.get() == 1 && state.get() == State.None) { + state.set(State.Active); nativeStartTransaction(); } return this; } public void commit() { - // trace("commit called, state = %s, depth = %d, this = %s", state.get(), depth.get(), this); + trace("commit called, state = %s, depth = %d, this = %s", state.get(), depth.get(), this); if (depth.get() == 1) { - if (state.get() == Transaction.State.None) { + if (state.get() == State.None) { return; } - if (state.get() == Transaction.State.Aborted) { + if (state.get() == State.Aborted) { depth.set(depth.get() - 1); return; } nativeEndTransaction(); - state.set(Transaction.State.Committed); + state.set(State.Committed); for (PersistentObject obj : constructions.get()) { ObjectCache.committedConstruction(obj); } @@ -122,9 +122,9 @@ public void commit() { } public void abort() { - // trace("abort called, state = %s, depth = %d, this = %s", state.get(), depth.get(), this); - if (state.get() != Transaction.State.Active) { - state.set(Transaction.State.Aborted); + trace("abort called, state = %s, depth = %d, this = %s", state.get(), depth.get(), this); + if (state.get() != State.Active) { + state.set(State.Aborted); releaseLocks(); return; } @@ -135,15 +135,15 @@ public void abort() { ObjectCache.remove(toUnlock.get(i).getPointer().addr()); } nativeAbortTransaction(); - // trace("nativeAbortTransaction called"); + trace("nativeAbortTransaction called"); constructions.get().clear(); - // trace("abort: constructions cleared"); - state.set(Transaction.State.Aborted); + trace("abort: constructions cleared"); + state.set(State.Aborted); releaseLocks(); } } - public Transaction.State state() { + public State state() { return state.get(); } diff --git a/src/test/java/tests/TestCases.java b/src/test/java/tests/TestCases.java index f490629..e047f45 100644 --- a/src/test/java/tests/TestCases.java +++ b/src/test/java/tests/TestCases.java @@ -23,14 +23,10 @@ import lib.util.persistent.*; import lib.util.persistent.types.*; -import lib.xpersistent.*; -import java.util.List; import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.Arrays; import java.util.ArrayList; import lib.util.persistent.spi.PersistentMemoryProvider; import lib.util.persistent.front.PersistentClass; -import examples.misc.*; import static lib.util.persistent.Persistent.*; public class TestCases { From eb85d29c96b4cddce74c42fea0ceb13d3438b119 Mon Sep 17 00:00:00 2001 From: Philippe PRADOS Date: Thu, 20 Jul 2017 15:00:41 +0200 Subject: [PATCH 2/3] Try PersistentByteChannel --- lib/tools/code.stg | 6 +- .../util/persistent/PersistentByteArray.java | 2 +- .../persistent/PersistentByteChannel.java | 152 ++++++++++++++++++ .../lib/util/persistent/PersistentHeap.java | 1 + .../util/persistent/PersistentInteger.java | 2 +- .../lib/util/persistent/PersistentLong.java | 2 +- .../UncheckedPersistentMemoryRegion.java | 3 + 7 files changed, 162 insertions(+), 6 deletions(-) create mode 100644 src/main/java/lib/util/persistent/PersistentByteChannel.java diff --git a/lib/tools/code.stg b/lib/tools/code.stg index 8ab1b2f..d9e52ba 100644 --- a/lib/tools/code.stg +++ b/lib/tools/code.stg @@ -52,7 +52,7 @@ import lib.util.persistent.front.PersistentClass; public final class Persistent extends PersistentObject implements Comparable\\> { private static final Field = new Field(); - private static final ObjectType\\> TYPE = ObjectType.fromFields(Persistent.class, ); + public static final ObjectType\\> TYPE = ObjectType.fromFields(Persistent.class, ); private static final long serialVersionUID = 1L; public Persistent( x) { @@ -150,7 +150,7 @@ import lib.util.persistent.front.PersistentClass; public final class PersistentImmutableArray extends AbstractPersistentImmutableArray { private static final long serialVersionUID = 1L; - private static final ArrayType\Array> TYPE = new ArrayType\<>(PersistentImmutableArray.class, Types.); + public static final ArrayType\Array> TYPE = new ArrayType\<>(PersistentImmutableArray.class, Types.); public PersistentImmutableArray([] array) { super(TYPE, array.length, array); @@ -206,7 +206,7 @@ import lib.util.persistent.front.PersistentClass; public final class PersistentArray extends AbstractPersistentArray { private static final long serialVersionUID = 1L; - private static final ArrayType\Array> TYPE = new ArrayType\<>(PersistentArray.class, Types.); + public static final ArrayType\Array> TYPE = new ArrayType\<>(PersistentArray.class, Types.); public PersistentArray(int size) { super(TYPE, size); diff --git a/src/main/java/lib/util/persistent/PersistentByteArray.java b/src/main/java/lib/util/persistent/PersistentByteArray.java index 041eab8..f7e3d17 100644 --- a/src/main/java/lib/util/persistent/PersistentByteArray.java +++ b/src/main/java/lib/util/persistent/PersistentByteArray.java @@ -30,7 +30,7 @@ public final class PersistentByteArray extends AbstractPersistentArray { private static final long serialVersionUID = 1L; - private static final ArrayType TYPE = new ArrayType<>(PersistentByteArray.class, Types.BYTE); + public static final ArrayType TYPE = new ArrayType<>(PersistentByteArray.class, Types.BYTE); public PersistentByteArray(int size) { super(TYPE, size); diff --git a/src/main/java/lib/util/persistent/PersistentByteChannel.java b/src/main/java/lib/util/persistent/PersistentByteChannel.java new file mode 100644 index 0000000..7b2496b --- /dev/null +++ b/src/main/java/lib/util/persistent/PersistentByteChannel.java @@ -0,0 +1,152 @@ +package lib.util.persistent; + +import lib.util.persistent.spi.PersistentMemoryProvider; +import lib.util.persistent.types.ArrayType; +import lib.util.persistent.types.DoubleField; +import lib.util.persistent.types.IntField; +import lib.util.persistent.types.LongField; +import lib.util.persistent.types.ObjectField; +import lib.util.persistent.types.ObjectType; +import lib.xpersistent.XHeap; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.ReadableByteChannel; +import java.nio.channels.SeekableByteChannel; +import java.nio.channels.WritableByteChannel; + +/** + * Created by pprados on 20/07/17. + */ +public class PersistentByteChannel extends PersistentObject + implements SeekableByteChannel,WritableByteChannel,ReadableByteChannel { + private static final ObjectField BUF = new ObjectField<>(PersistentByteArray.TYPE); + private static final IntField MAXSIZE = new IntField(); + private static final LongField POS = new LongField(); + public static final ObjectType TYPE = + ObjectType.fromFields(PersistentByteChannel.class, BUF,MAXSIZE,POS); + + private static final int BUF_SIZE=1024*10; + + public PersistentByteChannel(int initialeSize) { + super(TYPE); + Transaction.run(() -> { + maxsize((initialeSize+BUF_SIZE)/BUF_SIZE); + buf(new PersistentByteArray(maxsize())); + position(0L); + }); + } + private synchronized PersistentByteArray buf() { + return getObjectField(BUF); + } + private synchronized PersistentByteChannel buf(PersistentByteArray buf) { + setObjectField(BUF,buf); + return this; + } + private synchronized int maxsize() { return getIntField(MAXSIZE);} + private synchronized PersistentByteChannel maxsize(int newSize) { + setIntField(MAXSIZE,newSize); + return this; + } + private void memcpy(MemoryRegion srcRegion, long srcOffset, MemoryRegion destRegion, long destOffset, long length) { + heap.memcpy(srcRegion, srcOffset,destRegion,destOffset,length); + } + + private synchronized void extendbuf(int size) { + Transaction.run(() -> { + int newSize = (size+BUF_SIZE)/BUF_SIZE; + if (newSize { + int bytesToRead=dst.remaining(); + PersistentByteArray buf=buf(); + int end=Math.min(buf.length(),pos+bytesToRead); + // TODO: optimize + for (int i = pos; i < end; i++) dst.put(buf.getByteElement(i)); + position(end); + },this); + return (int)position()-pos; + } + + @Override + synchronized public int write(ByteBuffer src) { + int pos=(int)position(); + Transaction.run(() -> { + int bytesToWrite = src.remaining(); + int newMinimumSize=(int)position()+bytesToWrite; + if (size() { + setLongField(POS, newPosition); + },this); + return this; + } + + @Override + public long size() { + return buf().length(); + } + + @Override + public SeekableByteChannel truncate(long size) { + Transaction.run(() -> { + int newSize = ((int)size+BUF_SIZE)/BUF_SIZE; + if (newSizenewSize) + position(newSize); + },this); + return this; + } + + @Override + public boolean isOpen() { + return true; + } + + @Override + public void close() { + Transaction.run(() -> { + buf(new PersistentByteArray(0)); + }); + } + + public static void main(String[] args) { + PersistentByteChannel channel=new PersistentByteChannel(100); + System.out.println(channel.position()); + System.out.println(channel.maxsize()); + } +} diff --git a/src/main/java/lib/util/persistent/PersistentHeap.java b/src/main/java/lib/util/persistent/PersistentHeap.java index c45a4dc..d037fd0 100644 --- a/src/main/java/lib/util/persistent/PersistentHeap.java +++ b/src/main/java/lib/util/persistent/PersistentHeap.java @@ -27,4 +27,5 @@ public interface PersistentHeap { MemoryRegion allocateRegion(long size); void freeRegion(MemoryRegion region); Root getRoot(); + void memcpy(MemoryRegion srcRegion, long srcOffset, MemoryRegion destRegion, long destOffset, long length); } diff --git a/src/main/java/lib/util/persistent/PersistentInteger.java b/src/main/java/lib/util/persistent/PersistentInteger.java index 88fc209..981c341 100644 --- a/src/main/java/lib/util/persistent/PersistentInteger.java +++ b/src/main/java/lib/util/persistent/PersistentInteger.java @@ -30,7 +30,7 @@ public final class PersistentInteger extends PersistentObject implements Comparable { private static final IntField INT = new IntField(); - private static final ObjectType TYPE = ObjectType.fromFields(PersistentInteger.class, INT); + public static final ObjectType TYPE = ObjectType.fromFields(PersistentInteger.class, INT); private static final long serialVersionUID = 1L; public PersistentInteger(int x) { diff --git a/src/main/java/lib/util/persistent/PersistentLong.java b/src/main/java/lib/util/persistent/PersistentLong.java index fd81d7f..c89fc7f 100644 --- a/src/main/java/lib/util/persistent/PersistentLong.java +++ b/src/main/java/lib/util/persistent/PersistentLong.java @@ -30,7 +30,7 @@ public final class PersistentLong extends PersistentObject implements Comparable { private static final LongField LONG = new LongField(); - private static final ObjectType TYPE = ObjectType.fromFields(PersistentLong.class, LONG); + public static final ObjectType TYPE = ObjectType.fromFields(PersistentLong.class, LONG); private static final long serialVersionUID = 1L; public PersistentLong(long x) { diff --git a/src/main/java/lib/xpersistent/UncheckedPersistentMemoryRegion.java b/src/main/java/lib/xpersistent/UncheckedPersistentMemoryRegion.java index ab88235..7769585 100644 --- a/src/main/java/lib/xpersistent/UncheckedPersistentMemoryRegion.java +++ b/src/main/java/lib/xpersistent/UncheckedPersistentMemoryRegion.java @@ -22,9 +22,12 @@ package lib.xpersistent; import lib.util.persistent.MemoryRegion; +import lib.util.persistent.Transaction; +import java.util.concurrent.locks.ReentrantLock; public class UncheckedPersistentMemoryRegion implements MemoryRegion { private long addr; + private final ReentrantLock lock = new ReentrantLock(); static { System.loadLibrary("Persistent"); From a96d3fcab759eead821e5bfd3ba52a676c002792 Mon Sep 17 00:00:00 2001 From: Philippe PRADOS Date: Fri, 21 Jul 2017 12:34:21 +0200 Subject: [PATCH 3/3] Remove some import --- lib/tools/code.stg | 2 - .../AbstractPersistentImmutableArray.java | 4 +- src/main/java/lib/util/persistent/Config.java | 2 - .../java/lib/util/persistent/ObjectCache.java | 2 +- .../util/persistent/PersistentArrayList.java | 4 - .../persistent/PersistentByteChannel.java | 336 +++++++++++++++--- .../persistent/PersistentImmutableTuple1.java | 1 - .../PersistentImmutableTuple10.java | 1 - .../PersistentImmutableTuple11.java | 1 - .../PersistentImmutableTuple12.java | 1 - .../PersistentImmutableTuple13.java | 1 - .../PersistentImmutableTuple14.java | 1 - .../PersistentImmutableTuple15.java | 1 - .../PersistentImmutableTuple16.java | 1 - .../PersistentImmutableTuple17.java | 1 - .../PersistentImmutableTuple18.java | 1 - .../PersistentImmutableTuple19.java | 1 - .../persistent/PersistentImmutableTuple2.java | 1 - .../PersistentImmutableTuple20.java | 1 - .../PersistentImmutableTuple21.java | 1 - .../PersistentImmutableTuple22.java | 1 - .../persistent/PersistentImmutableTuple3.java | 1 - .../persistent/PersistentImmutableTuple4.java | 1 - .../persistent/PersistentImmutableTuple5.java | 1 - .../persistent/PersistentImmutableTuple6.java | 1 - .../persistent/PersistentImmutableTuple7.java | 1 - .../persistent/PersistentImmutableTuple8.java | 1 - .../persistent/PersistentImmutableTuple9.java | 1 - .../lib/util/persistent/PersistentObject.java | 8 +- .../persistent/PersistentSkipListMap.java | 4 - .../lib/util/persistent/PersistentString.java | 1 - .../lib/util/persistent/PersistentTuple1.java | 1 - .../util/persistent/PersistentTuple10.java | 1 - .../util/persistent/PersistentTuple11.java | 1 - .../util/persistent/PersistentTuple12.java | 1 - .../util/persistent/PersistentTuple13.java | 1 - .../util/persistent/PersistentTuple14.java | 1 - .../util/persistent/PersistentTuple15.java | 1 - .../util/persistent/PersistentTuple16.java | 1 - .../util/persistent/PersistentTuple17.java | 1 - .../util/persistent/PersistentTuple18.java | 1 - .../util/persistent/PersistentTuple19.java | 1 - .../lib/util/persistent/PersistentTuple2.java | 1 - .../util/persistent/PersistentTuple20.java | 1 - .../util/persistent/PersistentTuple21.java | 1 - .../util/persistent/PersistentTuple22.java | 1 - .../lib/util/persistent/PersistentTuple3.java | 1 - .../lib/util/persistent/PersistentTuple4.java | 1 - .../lib/util/persistent/PersistentTuple5.java | 1 - .../lib/util/persistent/PersistentTuple6.java | 1 - .../lib/util/persistent/PersistentTuple7.java | 1 - .../lib/util/persistent/PersistentTuple8.java | 1 - .../lib/util/persistent/PersistentTuple9.java | 1 - .../lib/util/persistent/PersistentValue.java | 5 +- .../util/persistent/PersistentValueArray.java | 2 - .../lib/util/persistent/TransactionInfo.java | 2 - .../lib/util/persistent/ValuePointer.java | 1 - .../spi/PersistentMemoryProvider.java | 1 - .../lib/util/persistent/types/ArrayType.java | 1 - .../lib/util/persistent/types/Indexed.java | 2 - .../java/lib/util/persistent/types/Named.java | 3 - .../util/persistent/types/ObjectField.java | 2 +- .../lib/util/persistent/types/ObjectType.java | 3 - .../util/persistent/types/PersistentType.java | 3 - .../lib/util/persistent/types/ValueType.java | 1 - .../UncheckedPersistentMemoryRegion.java | 1 - .../java/lib/xpersistent/XTransaction.java | 2 - 67 files changed, 290 insertions(+), 146 deletions(-) diff --git a/lib/tools/code.stg b/lib/tools/code.stg index d9e52ba..83e15e7 100644 --- a/lib/tools/code.stg +++ b/lib/tools/code.stg @@ -262,7 +262,6 @@ mjstuple_class(class_prefix, n, range) ::= << package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; @@ -347,7 +346,6 @@ mjsimmutabletuple_class(class_prefix, n, range) ::= << package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/AbstractPersistentImmutableArray.java b/src/main/java/lib/util/persistent/AbstractPersistentImmutableArray.java index 78d0783..2be3a57 100644 --- a/src/main/java/lib/util/persistent/AbstractPersistentImmutableArray.java +++ b/src/main/java/lib/util/persistent/AbstractPersistentImmutableArray.java @@ -68,7 +68,7 @@ protected PersistentValue getValueElement(int index, Class void setValueElement(int index, T value // System.out.println(String.format("setValueElement src addr = %d, dst addr = %d, size = %d", srcRegion.addr(), dstRegion.addr() + dstOffset, size)); synchronized(dstRegion) { synchronized(srcRegion) { - ((lib.xpersistent.XHeap)heap).memcpy(srcRegion, 0, dstRegion, dstOffset, size); + heap.memcpy(srcRegion, 0, dstRegion, dstOffset, size); } } } diff --git a/src/main/java/lib/util/persistent/Config.java b/src/main/java/lib/util/persistent/Config.java index 971bf1a..1449349 100644 --- a/src/main/java/lib/util/persistent/Config.java +++ b/src/main/java/lib/util/persistent/Config.java @@ -21,8 +21,6 @@ package lib.util.persistent; -import java.util.Random; - public class Config { public static final int MONITOR_ENTER_TIMEOUT = 30; // ms public static final int MAX_MONITOR_ENTER_TIMEOUT = 125; // ms diff --git a/src/main/java/lib/util/persistent/ObjectCache.java b/src/main/java/lib/util/persistent/ObjectCache.java index 50ca10f..804ef91 100755 --- a/src/main/java/lib/util/persistent/ObjectCache.java +++ b/src/main/java/lib/util/persistent/ObjectCache.java @@ -107,7 +107,7 @@ public PRef(T obj) { public PRef(T obj, boolean forAdmin) { super(obj, queue); - trace("created PRef object for address " + obj.getPointer().addr()); + //trace("created PRef object for address " + obj.getPointer().addr()); this.address = obj.getPointer().addr(); this.forAdmin = forAdmin; prefs.put(this.address, this); diff --git a/src/main/java/lib/util/persistent/PersistentArrayList.java b/src/main/java/lib/util/persistent/PersistentArrayList.java index e6f4e79..772fc4c 100644 --- a/src/main/java/lib/util/persistent/PersistentArrayList.java +++ b/src/main/java/lib/util/persistent/PersistentArrayList.java @@ -22,8 +22,6 @@ package lib.util.persistent; import lib.util.persistent.types.*; -import lib.util.persistent.types.Types; -import lib.util.persistent.types.ArrayType; import java.util.Collection; import java.util.Iterator; import java.util.ListIterator; @@ -31,8 +29,6 @@ import java.util.NoSuchElementException; import java.util.ConcurrentModificationException; import java.util.Objects; -import java.util.*; -import static lib.util.persistent.Persistent.*; public class PersistentArrayList extends PersistentObject implements Iterable { static final int DEFAULT_CAPACITY = 10; diff --git a/src/main/java/lib/util/persistent/PersistentByteChannel.java b/src/main/java/lib/util/persistent/PersistentByteChannel.java index 7b2496b..143c792 100644 --- a/src/main/java/lib/util/persistent/PersistentByteChannel.java +++ b/src/main/java/lib/util/persistent/PersistentByteChannel.java @@ -1,38 +1,56 @@ package lib.util.persistent; import lib.util.persistent.spi.PersistentMemoryProvider; -import lib.util.persistent.types.ArrayType; -import lib.util.persistent.types.DoubleField; -import lib.util.persistent.types.IntField; import lib.util.persistent.types.LongField; import lib.util.persistent.types.ObjectField; import lib.util.persistent.types.ObjectType; -import lib.xpersistent.XHeap; import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.channels.ReadableByteChannel; +import java.nio.channels.FileChannel; +import java.nio.channels.GatheringByteChannel; +import java.nio.channels.InterruptibleChannel; +import java.nio.channels.ScatteringByteChannel; import java.nio.channels.SeekableByteChannel; -import java.nio.channels.WritableByteChannel; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; +import java.util.Arrays; /** * Created by pprados on 20/07/17. */ -public class PersistentByteChannel extends PersistentObject - implements SeekableByteChannel,WritableByteChannel,ReadableByteChannel { +// TODO: faire une version avec des Heap et non des bytearrays. Permet de gerer les tailles long et est plus rapide +public class PersistentByteChannel extends PersistentObject // AbstractFileChannel + implements + SeekableByteChannel, + InterruptibleChannel, + GatheringByteChannel, + ScatteringByteChannel { private static final ObjectField BUF = new ObjectField<>(PersistentByteArray.TYPE); - private static final IntField MAXSIZE = new IntField(); + private static final LongField SIZE = new LongField(); private static final LongField POS = new LongField(); public static final ObjectType TYPE = - ObjectType.fromFields(PersistentByteChannel.class, BUF,MAXSIZE,POS); + ObjectType.fromFields(PersistentByteChannel.class, BUF,SIZE,POS); - private static final int BUF_SIZE=1024*10; + private static final int ROUND_BUF_SIZE =1; // FIXME 1024*5; - public PersistentByteChannel(int initialeSize) { + private int roundSize(long size) { + return (int)((size+ ROUND_BUF_SIZE)/ ROUND_BUF_SIZE)* ROUND_BUF_SIZE; + } + private PersistentByteChannel(ObjectPointer p) { + super(p); + } + private PersistentByteChannel(ObjectType type) { + super(type); + } + + public PersistentByteChannel() { this(ROUND_BUF_SIZE); } + public PersistentByteChannel(long initialeBufSize) { super(TYPE); Transaction.run(() -> { - maxsize((initialeSize+BUF_SIZE)/BUF_SIZE); - buf(new PersistentByteArray(maxsize())); + size(initialeBufSize); + buf(new PersistentByteArray(roundSize(initialeBufSize))); position(0L); }); } @@ -43,67 +61,151 @@ private synchronized PersistentByteChannel buf(PersistentByteArray buf) { setObjectField(BUF,buf); return this; } - private synchronized int maxsize() { return getIntField(MAXSIZE);} - private synchronized PersistentByteChannel maxsize(int newSize) { - setIntField(MAXSIZE,newSize); + private synchronized PersistentByteChannel size(long size) { + setLongField(SIZE,size); return this; } + + private synchronized int maxsize() { return buf().length();} private void memcpy(MemoryRegion srcRegion, long srcOffset, MemoryRegion destRegion, long destOffset, long length) { heap.memcpy(srcRegion, srcOffset,destRegion,destOffset,length); } - private synchronized void extendbuf(int size) { + private synchronized void extendbuf(long size) { Transaction.run(() -> { - int newSize = (size+BUF_SIZE)/BUF_SIZE; + long newSize = Math.max(roundSize(size),size()*2); if (newSizesize())) throw new IndexOutOfBoundsException(); + long oldposition=position(); + Transaction.run(() -> { + position(position); + read(dst); + }); + int bytesRead=(int)(position()-position); + position(oldposition); + return bytesRead; + } + + @Override + public synchronized long read(ByteBuffer[] dsts, int offset, final int length) { + long pos=position()+offset; + if (offset<0 || pos>size()) throw new IndexOutOfBoundsException(); Transaction.run(() -> { - int bytesToRead=dst.remaining(); + int l=length; + long p=pos; PersistentByteArray buf=buf(); - int end=Math.min(buf.length(),pos+bytesToRead); - // TODO: optimize - for (int i = pos; i < end; i++) dst.put(buf.getByteElement(i)); + long end=p; + for (ByteBuffer dst:dsts) { + int bytesToRead=Math.min(l,dst.remaining()); + end=Math.min(size(),p+bytesToRead); + // TODO: optimize with jni memcpy ? + for (long i = p; i < end; i++) dst.put(buf.getByteElement((int)i)); + l-=bytesToRead; + p=end; + } position(end); - },this); + },this); // TODO: onAbort pour repositionner les positions des dsts return (int)position()-pos; } + + @Override + public int write(ByteBuffer src) { + return (int)write(new ByteBuffer[]{src},0,Integer.MAX_VALUE); + } + @Override - synchronized public int write(ByteBuffer src) { - int pos=(int)position(); + public long write(ByteBuffer[] srcs) { + return write(srcs,0,Integer.MAX_VALUE); + } + + public int write(ByteBuffer src, long position) { + if ((position<0) || (position>size())) throw new IndexOutOfBoundsException(); + long oldposition=position(); Transaction.run(() -> { - int bytesToWrite = src.remaining(); - int newMinimumSize=(int)position()+bytesToWrite; - if (size()size()) throw new IndexOutOfBoundsException(); + Transaction.run(() -> { + int l=length; + long p=pos; + long newMinimumSize=p; + for (int i=0;isize()) size(end); },this); return (int)position()-pos; } + public long transferFrom(FileChannel src, + long position, long count) + throws IOException { + ByteBuffer buf=ByteBuffer.allocate((int)src.size()); + src.read(buf); + return write(buf); + } + + public long transferTo(long position, long count, + FileChannel target) + throws IOException { + ByteBuffer buf=ByteBuffer.allocate((int)count); + long rc=read(buf); + buf.rewind(); + target.write(buf,position); + return rc; + } @Override synchronized public long position() { return getLongField(POS); } @Override - synchronized public SeekableByteChannel position(long newPosition) { + synchronized public PersistentByteChannel position(long newPosition) { Transaction.run(() -> { setLongField(POS, newPosition); },this); @@ -112,22 +214,24 @@ synchronized public SeekableByteChannel position(long newPosition) { @Override public long size() { - return buf().length(); + return getLongField(SIZE); } @Override public SeekableByteChannel truncate(long size) { Transaction.run(() -> { - int newSize = ((int)size+BUF_SIZE)/BUF_SIZE; - if (newSizenewSize) - position(newSize); + int newSize = roundSize((int)size); + if (newSizesize) { + position(size); + } + size(size); },this); return this; } @@ -140,13 +244,135 @@ public boolean isOpen() { @Override public void close() { Transaction.run(() -> { - buf(new PersistentByteArray(0)); + buf(new PersistentByteArray(0)); // Replace buffer with empty + position(0); }); } - public static void main(String[] args) { - PersistentByteChannel channel=new PersistentByteChannel(100); - System.out.println(channel.position()); - System.out.println(channel.maxsize()); + private static byte[] toArray(PersistentByteChannel channel) { + channel.position(0); + ByteBuffer buf=ByteBuffer.allocate((int)channel.size()); + channel.read(buf); + return buf.array(); + } + + private static byte[] toArray(ByteBuffer buf) { + return toArray(new ByteBuffer[] { buf}); + } + private static byte[] toArray(ByteBuffer[] bufs) { + int size=0; + for (ByteBuffer buf:bufs) { + buf.rewind(); + size+=buf.remaining(); + } + byte[] rc=new byte[size]; + int offset=0; + for (ByteBuffer buf:bufs) { + buf.rewind(); + buf.get(rc,offset,buf.remaining()); + buf.rewind(); + offset+=buf.remaining(); + } + return rc; + } + + private static void dumpChannel(PersistentByteChannel channel) { + System.out.print("channel="); + long p=channel.position(); + channel.position(0); + ByteBuffer buf=ByteBuffer.allocate((int)channel.size()); + channel.read(buf); + buf.rewind(); + int len=buf.remaining(); + for (int i=0;i void setValueField(ValueFi MemoryRegion srcRegion = value.getPointer().region(); //trace("setValueField src addr = %d, dst addr = %d, size = %d", srcRegion.addr(), dstRegion.addr() + dstOffset, f.getType().getSize()); synchronized(srcRegion) { - // FIXME: circulare dependency between package XRoot and this package - ((XHeap)heap).memcpy(srcRegion, 0, dstRegion, dstOffset, f.getType().getSize()); + heap.memcpy(srcRegion, 0, dstRegion, dstOffset, f.getType().getSize()); } } @@ -474,7 +472,7 @@ static void deleteResidualReferences(long address, int count) { PersistentObject obj = ObjectCache.get(address, true); Transaction.run(() -> { int rc = obj.getRefCount(); - trace(address, "deleteResidualReferences %d, refCount = %d", count, obj.getRefCount()); + //trace(address, "deleteResidualReferences %d, refCount = %d", count, obj.getRefCount()); if (obj.getRefCount() < count) { throw new HeapCorruptedError("refcount < count"); } @@ -532,7 +530,7 @@ byte getColor() { } public static boolean monitorEnter(List toLock, List locked, boolean block) { - trace("monitorEnter (lists), starting toLock = %d, locked = %d, block = %s", toLock.size(), locked.size(), block); + //trace("monitorEnter (lists), starting toLock = %d, locked = %d, block = %s", toLock.size(), locked.size(), block); // toLock.sort((x, y) -> Long.compare(x.getPointer().addr(), y.getPointer().addr())); boolean success = true; for (PersistentObject obj : toLock) { diff --git a/src/main/java/lib/util/persistent/PersistentSkipListMap.java b/src/main/java/lib/util/persistent/PersistentSkipListMap.java index ff4f157..c928097 100644 --- a/src/main/java/lib/util/persistent/PersistentSkipListMap.java +++ b/src/main/java/lib/util/persistent/PersistentSkipListMap.java @@ -22,8 +22,6 @@ package lib.util.persistent; import lib.util.persistent.types.*; -import lib.util.persistent.types.Types; -import lib.util.persistent.types.ArrayType; import java.util.Collection; import java.util.Collections; import java.util.Comparator; @@ -46,9 +44,7 @@ import java.util.Set; import java.util.AbstractCollection; import java.util.NoSuchElementException; -import java.util.concurrent.atomic.AtomicReference; import lib.util.persistent.front.PersistentClass; -import static lib.util.persistent.Persistent.*; public class PersistentSkipListMap extends PersistentObject implements ConcurrentNavigableMap { private KeySet keySet; diff --git a/src/main/java/lib/util/persistent/PersistentString.java b/src/main/java/lib/util/persistent/PersistentString.java index 018d579..f3de53c 100644 --- a/src/main/java/lib/util/persistent/PersistentString.java +++ b/src/main/java/lib/util/persistent/PersistentString.java @@ -23,7 +23,6 @@ import lib.util.persistent.types.*; import lib.util.persistent.types.ObjectType; -import lib.util.persistent.types.ArrayType; import lib.util.persistent.front.PersistentClass; @PersistentClass diff --git a/src/main/java/lib/util/persistent/PersistentTuple1.java b/src/main/java/lib/util/persistent/PersistentTuple1.java index 81c7eab..def720e 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple1.java +++ b/src/main/java/lib/util/persistent/PersistentTuple1.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple10.java b/src/main/java/lib/util/persistent/PersistentTuple10.java index 35e2f33..d2a7cac 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple10.java +++ b/src/main/java/lib/util/persistent/PersistentTuple10.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple11.java b/src/main/java/lib/util/persistent/PersistentTuple11.java index fd1781f..8401a26 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple11.java +++ b/src/main/java/lib/util/persistent/PersistentTuple11.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple12.java b/src/main/java/lib/util/persistent/PersistentTuple12.java index ca756a1..558d610 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple12.java +++ b/src/main/java/lib/util/persistent/PersistentTuple12.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple13.java b/src/main/java/lib/util/persistent/PersistentTuple13.java index b41b5cf..219b17b 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple13.java +++ b/src/main/java/lib/util/persistent/PersistentTuple13.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple14.java b/src/main/java/lib/util/persistent/PersistentTuple14.java index 853b230..130d745 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple14.java +++ b/src/main/java/lib/util/persistent/PersistentTuple14.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple15.java b/src/main/java/lib/util/persistent/PersistentTuple15.java index deddc31..695fd5f 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple15.java +++ b/src/main/java/lib/util/persistent/PersistentTuple15.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple16.java b/src/main/java/lib/util/persistent/PersistentTuple16.java index 22e82bd..8ed7769 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple16.java +++ b/src/main/java/lib/util/persistent/PersistentTuple16.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple17.java b/src/main/java/lib/util/persistent/PersistentTuple17.java index 3761a5f..cf1e04a 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple17.java +++ b/src/main/java/lib/util/persistent/PersistentTuple17.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple18.java b/src/main/java/lib/util/persistent/PersistentTuple18.java index a09e0bd..c31fd9d 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple18.java +++ b/src/main/java/lib/util/persistent/PersistentTuple18.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple19.java b/src/main/java/lib/util/persistent/PersistentTuple19.java index 26dda83..032c50d 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple19.java +++ b/src/main/java/lib/util/persistent/PersistentTuple19.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple2.java b/src/main/java/lib/util/persistent/PersistentTuple2.java index f176b80..2e36259 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple2.java +++ b/src/main/java/lib/util/persistent/PersistentTuple2.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple20.java b/src/main/java/lib/util/persistent/PersistentTuple20.java index 5853919..8fa324f 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple20.java +++ b/src/main/java/lib/util/persistent/PersistentTuple20.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple21.java b/src/main/java/lib/util/persistent/PersistentTuple21.java index a78ef0b..20869a4 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple21.java +++ b/src/main/java/lib/util/persistent/PersistentTuple21.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple22.java b/src/main/java/lib/util/persistent/PersistentTuple22.java index 38c0569..6b33662 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple22.java +++ b/src/main/java/lib/util/persistent/PersistentTuple22.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple3.java b/src/main/java/lib/util/persistent/PersistentTuple3.java index c0b2242..72ecb37 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple3.java +++ b/src/main/java/lib/util/persistent/PersistentTuple3.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple4.java b/src/main/java/lib/util/persistent/PersistentTuple4.java index dc9b0d3..27aad95 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple4.java +++ b/src/main/java/lib/util/persistent/PersistentTuple4.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple5.java b/src/main/java/lib/util/persistent/PersistentTuple5.java index 9b9e78f..f1923a7 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple5.java +++ b/src/main/java/lib/util/persistent/PersistentTuple5.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple6.java b/src/main/java/lib/util/persistent/PersistentTuple6.java index b6fe2f8..f8b8d00 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple6.java +++ b/src/main/java/lib/util/persistent/PersistentTuple6.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple7.java b/src/main/java/lib/util/persistent/PersistentTuple7.java index e0916ba..85de91c 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple7.java +++ b/src/main/java/lib/util/persistent/PersistentTuple7.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple8.java b/src/main/java/lib/util/persistent/PersistentTuple8.java index 8e0614c..ed35b7e 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple8.java +++ b/src/main/java/lib/util/persistent/PersistentTuple8.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentTuple9.java b/src/main/java/lib/util/persistent/PersistentTuple9.java index 530b736..de77dab 100644 --- a/src/main/java/lib/util/persistent/PersistentTuple9.java +++ b/src/main/java/lib/util/persistent/PersistentTuple9.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.Types; import lib.util.persistent.types.ObjectType; import lib.util.persistent.types.ObjectField; import lib.util.persistent.front.PersistentClass; diff --git a/src/main/java/lib/util/persistent/PersistentValue.java b/src/main/java/lib/util/persistent/PersistentValue.java index 9d3443f..364b5c5 100644 --- a/src/main/java/lib/util/persistent/PersistentValue.java +++ b/src/main/java/lib/util/persistent/PersistentValue.java @@ -31,7 +31,6 @@ import lib.util.persistent.types.BooleanField; import lib.util.persistent.types.ValueField; import lib.util.persistent.types.ValueType; -import lib.util.persistent.types.PersistentType; import lib.util.persistent.spi.PersistentMemoryProvider; // TODO: factor common accessor code out of PersistentValue and PersistentObject @@ -74,7 +73,7 @@ public T getValueField(ValueField f) { MemoryRegion dstRegion = heap.allocateRegion(f.getType().getSize()); // System.out.println(String.format("getValueField @ index %d, src addr = %d, dst addr = %d, size = %d", f.getIndex(), srcRegion.addr(), dstRegion.addr(), f.getType().getSize())); synchronized(srcRegion) { - ((lib.xpersistent.XHeap)heap).memcpy(srcRegion, offset(f.getIndex()), dstRegion, 0, f.getType().getSize()); + heap.memcpy(srcRegion, offset(f.getIndex()), dstRegion, 0, f.getType().getSize()); } return (T)new ValuePointer((ValueType)f.getType(), dstRegion, f.cls()).deref(); } @@ -95,7 +94,7 @@ public void setValueField(ValueField f, T value) // System.out.println(String.format("setValueField @index %d, src addr = %d, dst addr = %d, size = %d", f.getIndex(), srcRegion.addr(), dstRegion.addr() + dstOffset, f.getType().getSize())); synchronized(dstRegion) { synchronized(srcRegion) { - ((lib.xpersistent.XHeap)heap).memcpy(srcRegion, 0, dstRegion, dstOffset, f.getType().getSize()); + heap.memcpy(srcRegion, 0, dstRegion, dstOffset, f.getType().getSize()); } } } diff --git a/src/main/java/lib/util/persistent/PersistentValueArray.java b/src/main/java/lib/util/persistent/PersistentValueArray.java index ab9e7ad..96e539e 100644 --- a/src/main/java/lib/util/persistent/PersistentValueArray.java +++ b/src/main/java/lib/util/persistent/PersistentValueArray.java @@ -24,8 +24,6 @@ import lib.util.persistent.types.Types; import lib.util.persistent.types.ValueArrayType; import lib.util.persistent.types.ArrayType; -import lib.util.persistent.types.ValueType; -import java.lang.reflect.Array; public final class PersistentValueArray extends AbstractPersistentArray { public static final ArrayType TYPE = new ArrayType<>(PersistentValueArray.class, Types.VALUE); diff --git a/src/main/java/lib/util/persistent/TransactionInfo.java b/src/main/java/lib/util/persistent/TransactionInfo.java index 1789f96..928b095 100644 --- a/src/main/java/lib/util/persistent/TransactionInfo.java +++ b/src/main/java/lib/util/persistent/TransactionInfo.java @@ -21,10 +21,8 @@ package lib.util.persistent; -import lib.util.persistent.PersistentObject; import lib.xpersistent.XTransaction; import java.util.ArrayList; -import static lib.util.persistent.Trace.trace; public class TransactionInfo { public XTransaction transaction; diff --git a/src/main/java/lib/util/persistent/ValuePointer.java b/src/main/java/lib/util/persistent/ValuePointer.java index f9cecd8..df7a0c9 100644 --- a/src/main/java/lib/util/persistent/ValuePointer.java +++ b/src/main/java/lib/util/persistent/ValuePointer.java @@ -21,7 +21,6 @@ package lib.util.persistent; -import lib.util.persistent.types.PersistentType; import lib.util.persistent.types.ValueType; import java.lang.reflect.Constructor; diff --git a/src/main/java/lib/util/persistent/spi/PersistentMemoryProvider.java b/src/main/java/lib/util/persistent/spi/PersistentMemoryProvider.java index ed9453f..bc9b16e 100644 --- a/src/main/java/lib/util/persistent/spi/PersistentMemoryProvider.java +++ b/src/main/java/lib/util/persistent/spi/PersistentMemoryProvider.java @@ -26,7 +26,6 @@ import lib.util.persistent.Transaction; import lib.xpersistent.XPersistentMemory; import lib.util.persistent.PersistentHeap; -import lib.xpersistent.XHeap; public abstract class PersistentMemoryProvider { private static final ConcurrentHashMap providers; diff --git a/src/main/java/lib/util/persistent/types/ArrayType.java b/src/main/java/lib/util/persistent/types/ArrayType.java index 9fa216c..3f97817 100644 --- a/src/main/java/lib/util/persistent/types/ArrayType.java +++ b/src/main/java/lib/util/persistent/types/ArrayType.java @@ -22,7 +22,6 @@ package lib.util.persistent.types; import lib.util.persistent.PersistentObject; -import java.util.ArrayList; public class ArrayType extends ObjectType { protected PersistentType elementType; diff --git a/src/main/java/lib/util/persistent/types/Indexed.java b/src/main/java/lib/util/persistent/types/Indexed.java index ef3854a..3f252d0 100644 --- a/src/main/java/lib/util/persistent/types/Indexed.java +++ b/src/main/java/lib/util/persistent/types/Indexed.java @@ -21,8 +21,6 @@ package lib.util.persistent.types; -import lib.util.persistent.PersistentObject; - public interface Indexed extends PersistentType { public long getOffset(int index); } diff --git a/src/main/java/lib/util/persistent/types/Named.java b/src/main/java/lib/util/persistent/types/Named.java index 638f5bd..2c1da57 100644 --- a/src/main/java/lib/util/persistent/types/Named.java +++ b/src/main/java/lib/util/persistent/types/Named.java @@ -21,9 +21,6 @@ package lib.util.persistent.types; -import lib.util.persistent.PersistentObject; -import lib.util.persistent.PersistentString; - public interface Named { String getName(); diff --git a/src/main/java/lib/util/persistent/types/ObjectField.java b/src/main/java/lib/util/persistent/types/ObjectField.java index 7e46f4f..92baa26 100644 --- a/src/main/java/lib/util/persistent/types/ObjectField.java +++ b/src/main/java/lib/util/persistent/types/ObjectField.java @@ -26,7 +26,7 @@ public class ObjectField extends PersistentField { private Class cls; - public ObjectField(ObjectType type) { + public ObjectField(ObjectType type) { super(type); } diff --git a/src/main/java/lib/util/persistent/types/ObjectType.java b/src/main/java/lib/util/persistent/types/ObjectType.java index 7fc3930..521c198 100644 --- a/src/main/java/lib/util/persistent/types/ObjectType.java +++ b/src/main/java/lib/util/persistent/types/ObjectType.java @@ -25,10 +25,7 @@ import java.util.ArrayList; import java.util.List; import lib.util.persistent.PersistentObject; -import lib.util.persistent.ObjectDirectory; -import lib.util.persistent.PersistentString; import lib.util.persistent.Header; -import java.lang.reflect.Field; public class ObjectType implements Named, Container { public static long FIELDS_OFFSET = Header.TYPE.getAllocationSize(); // room for header fields; diff --git a/src/main/java/lib/util/persistent/types/PersistentType.java b/src/main/java/lib/util/persistent/types/PersistentType.java index a73867f..e85c2a7 100644 --- a/src/main/java/lib/util/persistent/types/PersistentType.java +++ b/src/main/java/lib/util/persistent/types/PersistentType.java @@ -21,9 +21,6 @@ package lib.util.persistent.types; -import lib.util.persistent.PersistentObject; -import lib.util.persistent.PersistentString; - public interface PersistentType { long getSize(); } diff --git a/src/main/java/lib/util/persistent/types/ValueType.java b/src/main/java/lib/util/persistent/types/ValueType.java index 7ca3924..308c153 100644 --- a/src/main/java/lib/util/persistent/types/ValueType.java +++ b/src/main/java/lib/util/persistent/types/ValueType.java @@ -23,7 +23,6 @@ import java.util.List; import java.util.ArrayList; -import lib.util.persistent.PersistentValue; public class ValueType implements Container { private final List types; diff --git a/src/main/java/lib/xpersistent/UncheckedPersistentMemoryRegion.java b/src/main/java/lib/xpersistent/UncheckedPersistentMemoryRegion.java index 7769585..85c337f 100644 --- a/src/main/java/lib/xpersistent/UncheckedPersistentMemoryRegion.java +++ b/src/main/java/lib/xpersistent/UncheckedPersistentMemoryRegion.java @@ -22,7 +22,6 @@ package lib.xpersistent; import lib.util.persistent.MemoryRegion; -import lib.util.persistent.Transaction; import java.util.concurrent.locks.ReentrantLock; public class UncheckedPersistentMemoryRegion implements MemoryRegion { diff --git a/src/main/java/lib/xpersistent/XTransaction.java b/src/main/java/lib/xpersistent/XTransaction.java index bf8e231..f9915ca 100644 --- a/src/main/java/lib/xpersistent/XTransaction.java +++ b/src/main/java/lib/xpersistent/XTransaction.java @@ -22,9 +22,7 @@ package lib.xpersistent; import lib.util.persistent.*; -import lib.util.persistent.spi.PersistentMemoryProvider; import java.util.ArrayList; -import static lib.util.persistent.Trace.trace; public class XTransaction implements Transaction {