Thread: [Joafip-svn] SF.net SVN: joafip:[3045] trunk (Page 5)
Brought to you by:
luc_peuvrier
|
From: <luc...@us...> - 2012-04-29 16:58:22
|
Revision: 3045
http://joafip.svn.sourceforge.net/joafip/?rev=3045&view=rev
Author: luc_peuvrier
Date: 2012-04-29 16:58:13 +0000 (Sun, 29 Apr 2012)
Log Message:
-----------
WIP btree plus: implementation independant move to common joafip-kvstore
Modified Paths:
--------------
trunk/joafip/src/test/java/net/sf/joafip/service/TestDataManagerMultiFile.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumPersistenceMemory.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/AbstractTestSubstitutionWithMethodInterception.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestExclusiveDataAccessSession.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestGarbageForegroundMemory.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestGarbageInBackground.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestLinkManagementInMemory.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestNoGarbageInMemory.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestObjectReferenceLinkInMemory.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreForPersistenteClassMemoryDirect.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreForPersistenteClassMemoryLazy.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreVisitedModified.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreWithBobMemoryDirect.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreWithBobMemoryLazy.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/TestPersistableCodeGeneratorInStore.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/TestLinkManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/TestStoreGarbager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/AbstractTestIoManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyFieldReflect.java
trunk/joafip-4test/src/main/java/net/sf/joafip/bugtree/MainTreeDual.java
trunk/joafip-4test/src/main/java/net/sf/joafip/bugtree/MainTreeMultiFile.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/HeapFileCheckerDataManager.java
Added Paths:
-----------
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/DualWrapDataManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/FileForStorableBridge.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/HeapMemoryDataManagerMock.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/HeapMultiFileDataManager.java
Removed Paths:
-------------
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/DualWrapDataManager.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/FileForStorableBridge.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/HeapMemoryDataManagerMock.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/HeapMultiFileDataManager.java
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestDataManagerMultiFile.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestDataManagerMultiFile.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestDataManagerMultiFile.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -22,7 +22,7 @@
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestConstant;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMultiFileDataManager;
+import net.sf.joafip.kvstore.service.HeapMultiFileDataManager;
/**
*
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumPersistenceMemory.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumPersistenceMemory.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumPersistenceMemory.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -31,7 +31,7 @@
import net.sf.joafip.TestException;
import net.sf.joafip.entity.EnumFilePersistenceCloseAction;
import net.sf.joafip.entity.MutableInteger;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.service.FilePersistenceBuilder;
import net.sf.joafip.service.FilePersistenceClassNotFoundException;
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/rel300/AbstractTestSubstitutionWithMethodInterception.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/rel300/AbstractTestSubstitutionWithMethodInterception.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/rel300/AbstractTestSubstitutionWithMethodInterception.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -26,7 +26,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.service.FilePersistence;
import net.sf.joafip.service.FilePersistenceBuilder;
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestExclusiveDataAccessSession.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestExclusiveDataAccessSession.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestExclusiveDataAccessSession.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -26,7 +26,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.service.FilePersistence;
import net.sf.joafip.service.FilePersistenceBuilder;
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/TestGarbageForegroundMemory.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/TestGarbageForegroundMemory.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/TestGarbageForegroundMemory.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -19,7 +19,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
/**
* garbage in foreground implementation
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/TestGarbageInBackground.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/TestGarbageInBackground.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/TestGarbageInBackground.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -19,7 +19,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
/**
* garbage in background implementation
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/TestLinkManagementInMemory.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/TestLinkManagementInMemory.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/TestLinkManagementInMemory.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -19,7 +19,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
/**
* test reference link management for garbage in memory<br>
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/TestNoGarbageInMemory.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/TestNoGarbageInMemory.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/TestNoGarbageInMemory.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -19,7 +19,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
/**
*
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/TestObjectReferenceLinkInMemory.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/TestObjectReferenceLinkInMemory.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/TestObjectReferenceLinkInMemory.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -19,7 +19,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
/**
*
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreForPersistenteClassMemoryDirect.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreForPersistenteClassMemoryDirect.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreForPersistenteClassMemoryDirect.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -19,7 +19,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
@NotStorableClass
@StorableAccess
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreForPersistenteClassMemoryLazy.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreForPersistenteClassMemoryLazy.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreForPersistenteClassMemoryLazy.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -19,7 +19,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
@NotStorableClass
@StorableAccess
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreVisitedModified.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreVisitedModified.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreVisitedModified.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -29,7 +29,7 @@
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
import net.sf.joafip.entity.MutableInteger;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.store.entity.ForTestVisitedModified;
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreWithBobMemoryDirect.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreWithBobMemoryDirect.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreWithBobMemoryDirect.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -19,7 +19,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
@NotStorableClass
@StorableAccess
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreWithBobMemoryLazy.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreWithBobMemoryLazy.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreWithBobMemoryLazy.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -19,7 +19,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
@NotStorableClass
@StorableAccess
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/TestPersistableCodeGeneratorInStore.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/TestPersistableCodeGeneratorInStore.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/TestPersistableCodeGeneratorInStore.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -21,7 +21,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.store.service.StoreClassNotFoundException;
import net.sf.joafip.store.service.StoreDataCorruptedException;
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/TestLinkManager.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/TestLinkManager.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/TestLinkManager.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -29,8 +29,8 @@
import net.sf.joafip.DoNotTransform;
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.store.entity.StoreHeader;
import net.sf.joafip.store.entity.garbage.ReferenceLinkGarbageException;
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/TestStoreGarbager.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/TestStoreGarbager.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/TestStoreGarbager.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -36,9 +36,9 @@
import net.sf.joafip.DoNotTransform;
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
import net.sf.joafip.kvstore.service.HeapException;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.redblacktree.service.RBTException;
import net.sf.joafip.service.JoafipMutex;
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/AbstractTestIoManager.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/AbstractTestIoManager.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/AbstractTestIoManager.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -28,9 +28,9 @@
import net.sf.joafip.DoNotTransform;
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
import net.sf.joafip.kvstore.service.HeapException;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.service.ClassLoaderProvider;
import net.sf.joafip.store.entity.StoreSynchro;
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyFieldReflect.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyFieldReflect.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyFieldReflect.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -21,8 +21,8 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.HeapMemoryDataManagerMock;
import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
+import net.sf.joafip.kvstore.service.HeapMemoryDataManagerMock;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.service.ClassLoaderProvider;
import net.sf.joafip.store.entity.StoreHeader;
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/bugtree/MainTreeDual.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/bugtree/MainTreeDual.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/bugtree/MainTreeDual.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -5,10 +5,10 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.service.DualWrapDataManager;
import net.sf.joafip.heapfile.service.HeapFileDataManager;
import net.sf.joafip.kvstore.entity.HeapFileSetup;
import net.sf.joafip.kvstore.service.BlockDataManager;
+import net.sf.joafip.kvstore.service.DualWrapDataManager;
import net.sf.joafip.kvstore.service.HeapException;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.redblacktree.service.RBTException;
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/bugtree/MainTreeMultiFile.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/bugtree/MainTreeMultiFile.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/bugtree/MainTreeMultiFile.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -4,7 +4,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
-import net.sf.joafip.heapfile.service.HeapMultiFileDataManager;
+import net.sf.joafip.kvstore.service.HeapMultiFileDataManager;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.redblacktree.service.RBTException;
import net.sf.joafip.service.FilePersistenceBuilder;
Deleted: trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/DualWrapDataManager.java
===================================================================
--- trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/DualWrapDataManager.java 2012-04-29 16:51:38 UTC (rev 3044)
+++ trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/DualWrapDataManager.java 2012-04-29 16:58:13 UTC (rev 3045)
@@ -1,370 +0,0 @@
-/*
- * Copyright 2011 Luc Peuvrier
- *
- * This file is a part of JOAFIP.
- *
- * JOAFIP is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License.
- *
- * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
- * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl.html
- *
- * JOAFIP is distributed in the hope that it will be useful, but
- * unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.joafip.heapfile.service;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Set;
-
-import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
-import net.sf.joafip.kvstore.record.service.IDataRecordKeyManager;
-import net.sf.joafip.kvstore.service.HeapException;
-import net.sf.joafip.kvstore.service.HeapRuntimeException;
-import net.sf.joafip.kvstore.service.IHeapDataManager;
-
-/**
- *
- * @author luc peuvrier
- *
- */
-public class DualWrapDataManager implements IHeapDataManager {
-
- private static final String DATA_RECORD_MISMATCH = "data record mismatch ";
-
- private final IHeapDataManager firstDataManager;
-
- private final IHeapDataManager secondDataManager;
-
- public DualWrapDataManager(final IHeapDataManager firstDataManager,
- final IHeapDataManager secondDataManager) {
- super();
- this.firstDataManager = firstDataManager;
- this.secondDataManager = secondDataManager;
- }
-
- @Override
- public boolean isDataLost() {
- // no implementation
- return false;
- }
-
- @Override
- public void startService(final boolean removeFiles) throws HeapException {
- firstDataManager.startService(removeFiles);
- secondDataManager.startService(removeFiles);
- }
-
- @Override
- public void stopService() throws HeapException {
- firstDataManager.stopService();
- secondDataManager.stopService();
- }
-
- @Override
- public boolean isServiceStarted() {
- final boolean started1 = firstDataManager.isServiceStarted();
- final boolean started2 = secondDataManager.isServiceStarted();
- if (started1 != started2) {
- throw new HeapRuntimeException("started stated missmatch "
- + started1 + " " + started2);
- }
- return started1;
- }
-
- @Override
- public void clear() throws HeapException {
- firstDataManager.clear();
- secondDataManager.clear();
- }
-
- @Override
- public DataRecordIdentifier getNextFreeDataRecordIdentifier()
- throws HeapException {
- final DataRecordIdentifier next1 = firstDataManager
- .getNextFreeDataRecordIdentifier();
- final DataRecordIdentifier next2 = secondDataManager
- .getNextFreeDataRecordIdentifier();
- if (next1.value != next2.value) {
- throw new HeapException("new data record identifier missmatch "
- + next1.value + " " + next2.value);
- }
- return next1;
- }
-
- @Override
- public void setNextFreeDataRecordIdentifier(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- firstDataManager.setNextFreeDataRecordIdentifier(dataRecordIdentifier);
- secondDataManager.setNextFreeDataRecordIdentifier(dataRecordIdentifier);
- }
-
- @Override
- public DataRecordIdentifier getNewDataRecordIdentifier()
- throws HeapException {
- final DataRecordIdentifier new1 = firstDataManager
- .getNewDataRecordIdentifier();
- final DataRecordIdentifier new2 = secondDataManager
- .getNewDataRecordIdentifier();
- if (new1.value != new2.value) {
- throw new HeapException("new data record identifier missmatch "
- + new1.value + " " + new2.value);
- }
- return new1;
- }
-
- @Override
- public boolean hasDataRecord(final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- final boolean has1 = firstDataManager
- .hasDataRecord(dataRecordIdentifier);
- final boolean has2 = secondDataManager
- .hasDataRecord(dataRecordIdentifier);
- if (has1 != has2) {
- throw new HeapException("has data record missmatch " + has1 + " "
- + has2);
- }
- return has1;
- }
-
- @Override
- public byte[] readDataRecord(final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- final byte[] data1 = firstDataManager
- .readDataRecord(dataRecordIdentifier);
- final byte[] data2 = secondDataManager
- .readDataRecord(dataRecordIdentifier);
- if (!Arrays.equals(data1, data2)) {
- throw new HeapException("data differs");
- }
- return data1;
- }
-
- @Override
- public boolean writeDataRecord(
- final DataRecordIdentifier dataRecordIdentifier, final byte[] data)
- throws HeapException {
- final boolean created1 = firstDataManager.writeDataRecord(
- dataRecordIdentifier, data);
- final boolean created2 = secondDataManager.writeDataRecord(
- dataRecordIdentifier, data);
- if (created1 != created2) {
- throw new HeapException("created state missmatch " + created1 + " "
- + created2 + " for " + dataRecordIdentifier);
- }
- return created1;
- }
-
- @Override
- public boolean deleteDataRecord(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- final boolean deleted1 = firstDataManager
- .deleteDataRecord(dataRecordIdentifier);
- final boolean deleted2 = secondDataManager
- .deleteDataRecord(dataRecordIdentifier);
- if (deleted1 != deleted2) {
- throw new HeapException("deleted state missmatch " + deleted1 + " "
- + deleted2);
- }
- return deleted1;
- }
-
- @Override
- public DataRecordIdentifier removeFirstDataRecord() throws HeapException {
- final DataRecordIdentifier dr1 = firstDataManager
- .removeFirstDataRecord();
- final DataRecordIdentifier dr2 = secondDataManager
- .removeFirstDataRecord();
- if (dr1.value != dr2.value) {
- throw new HeapException(DATA_RECORD_MISMATCH + dr1.value + " "
- + dr2.value);
- }
- return dr1;
- }
-
- @Override
- public void flush() throws HeapException {
- firstDataManager.flush();
- secondDataManager.flush();
- }
-
- @Override
- public void clearStandbyModification() throws HeapException {
- firstDataManager.clearStandbyModification();
- secondDataManager.clearStandbyModification();
- }
-
- @Override
- public DataRecordIdentifier firstDataRecordIdentifier()
- throws HeapException {
- final DataRecordIdentifier dr1 = firstDataManager
- .firstDataRecordIdentifier();
- final DataRecordIdentifier dr2 = secondDataManager
- .firstDataRecordIdentifier();
- if (dr1.value != dr2.value) {
- throw new HeapException(DATA_RECORD_MISMATCH + dr1.value + " "
- + dr2.value);
- }
- return dr1;
- }
-
- @Override
- public DataRecordIdentifier lastDataRecordIdentifier() throws HeapException {
- final DataRecordIdentifier dr1 = firstDataManager
- .lastDataRecordIdentifier();
- final DataRecordIdentifier dr2 = secondDataManager
- .lastDataRecordIdentifier();
- if (dr1.value != dr2.value) {
- throw new HeapException(DATA_RECORD_MISMATCH + dr1.value + " "
- + dr2.value);
- }
- return dr1;
- }
-
- @Override
- public DataRecordIdentifier lowerDataRecordIdentifier(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- final DataRecordIdentifier dr1 = firstDataManager
- .lowerDataRecordIdentifier(dataRecordIdentifier);
- final DataRecordIdentifier dr2 = secondDataManager
- .lowerDataRecordIdentifier(dataRecordIdentifier);
- if (dr1.value != dr2.value) {
- throw new HeapException(DATA_RECORD_MISMATCH + dr1.value + " "
- + dr2.value);
- }
- return dr1;
- }
-
- @Override
- public DataRecordIdentifier floorDataRecordIdentifier(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- final DataRecordIdentifier dr1 = firstDataManager
- .floorDataRecordIdentifier(dataRecordIdentifier);
- final DataRecordIdentifier dr2 = secondDataManager
- .floorDataRecordIdentifier(dataRecordIdentifier);
- if (dr1.value != dr2.value) {
- throw new HeapException(DATA_RECORD_MISMATCH + dr1.value + " "
- + dr2.value);
- }
- return dr1;
- }
-
- @Override
- public DataRecordIdentifier ceilingDataRecordIdentifier(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- final DataRecordIdentifier dr1 = firstDataManager
- .ceilingDataRecordIdentifier(dataRecordIdentifier);
- final DataRecordIdentifier dr2 = secondDataManager
- .ceilingDataRecordIdentifier(dataRecordIdentifier);
- if (dr1.value != dr2.value) {
- throw new HeapException(DATA_RECORD_MISMATCH + dr1.value + " "
- + dr2.value);
- }
- return dr1;
- }
-
- @Override
- public DataRecordIdentifier higherDataRecordIdentifier(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- final DataRecordIdentifier dr1 = firstDataManager
- .higherDataRecordIdentifier(dataRecordIdentifier);
- final DataRecordIdentifier dr2 = secondDataManager
- .higherDataRecordIdentifier(dataRecordIdentifier);
- if (dr1.value != dr2.value) {
- throw new HeapException(DATA_RECORD_MISMATCH + dr1.value + " "
- + dr2.value);
- }
- return dr1;
- }
-
- @Override
- public int getNumberOfDataRecord() throws HeapException {
- // no implementation
- return 0;
- }
-
- @Override
- public int getNumberOfFreeRecord() throws HeapException {
- // no implementation
- ret...
[truncated message content] |
|
From: <luc...@us...> - 2012-04-29 21:13:13
|
Revision: 3048
http://joafip.svn.sourceforge.net/joafip/?rev=3048&view=rev
Author: luc_peuvrier
Date: 2012-04-29 21:13:04 +0000 (Sun, 29 Apr 2012)
Log Message:
-----------
WIP btree plus: implementation independant move to common joafip-kvstore. tests added for btree++, these tests failed
Modified Paths:
--------------
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrMemoryLeak.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrWithKey.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrWithScenario.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestHeapDataManagerBackup.java
trunk/joafip-pmap/src/main/java/net/sf/joafip/pmap/FileTreeMap.java
trunk/joafip-pmap/src/main/java/net/sf/joafip/pmap/FileTreeMapKeyMgr.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/PersistenceLongTestsOnly.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusServiceTests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/kvstore/service/KeyValueStoreServiceTests.java
Added Paths:
-----------
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataManagerBackup.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrMemoryLeak.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrWithKey.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrWithScenario.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/AbstractDataRecordKeyComparator.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/DataRecordKeyManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTesDataMgrWithKey.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestDataMgrMemoryLeak.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestDataMgrWithScenario.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/scenario1.txt
trunk/joafip-testsuite/src/main/java/net/sf/joafip/kvstore/KeyValueStoreLongTests.java
Removed Paths:
-------------
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/service/AbstractDataRecordKeyComparator.java
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/service/DataRecordKeyManager.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/scenario1.txt
Added: trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataManagerBackup.java
===================================================================
--- trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataManagerBackup.java (rev 0)
+++ trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataManagerBackup.java 2012-04-29 21:13:04 UTC (rev 3048)
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2012 Luc Peuvrier
+ * All rights reserved.
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.btreeplus.service;
+
+import net.sf.joafip.DoNotTransform;
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.TestException;
+import net.sf.joafip.kvstore.entity.HeapFileSetup;
+import net.sf.joafip.kvstore.service.AbstractTestHeapDataManagerBackup;
+import net.sf.joafip.kvstore.service.HeapException;
+import net.sf.joafip.kvstore.service.IHeapDataManager;
+
+@NotStorableClass
+@DoNotTransform
+public class TestBtreePlusDataManagerBackup extends
+ AbstractTestHeapDataManagerBackup {
+
+ public TestBtreePlusDataManagerBackup() throws TestException {
+ super();
+ }
+
+ public TestBtreePlusDataManagerBackup(final String name)
+ throws TestException {
+ super(name);
+ }
+
+ @Override
+ protected IHeapDataManager createHeapDataManager(final HeapFileSetup setup)
+ throws HeapException {
+ return new BtreePlusDataManager(setup);
+ }
+
+ @Override
+ protected void createHeap(final boolean removeFile) throws HeapException {
+ createFileHeapDataManager(removeFile);
+ }
+
+ @Override
+ protected boolean manageFreeRecord() {
+ return true;
+ }
+
+ @Override
+ protected void checkIntegrity() throws HeapException {
+ }
+}
Added: trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrMemoryLeak.java
===================================================================
--- trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrMemoryLeak.java (rev 0)
+++ trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrMemoryLeak.java 2012-04-29 21:13:04 UTC (rev 3048)
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2012 Luc Peuvrier
+ * All rights reserved.
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.btreeplus.service;
+
+import net.sf.joafip.DoNotTransform;
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.TestException;
+import net.sf.joafip.kvstore.entity.HeapFileSetup;
+import net.sf.joafip.kvstore.service.AbstractTestHeapDataManager;
+import net.sf.joafip.kvstore.service.HeapException;
+import net.sf.joafip.kvstore.service.IHeapDataManager;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+@DoNotTransform
+public class TestBtreePlusDataMgrMemoryLeak extends AbstractTestHeapDataManager {
+
+ public TestBtreePlusDataMgrMemoryLeak() throws TestException {
+ super();
+ }
+
+ public TestBtreePlusDataMgrMemoryLeak(final String name)
+ throws TestException {
+ super(name);
+ }
+
+ @Override
+ protected void createHeap(final boolean removeFile) throws HeapException {
+ createFileHeapDataManager(removeFile);
+ }
+
+ @Override
+ protected boolean manageFreeRecord() {
+ return true;
+ }
+
+ @Override
+ protected void setUp() throws Exception {// NOPMD
+ super.setUp();
+ createHeap(true);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {// NOPMD
+ super.tearDown();
+ }
+
+ @Override
+ protected IHeapDataManager createHeapDataManager(final HeapFileSetup setup)
+ throws HeapException {
+ return new BtreePlusDataManager(setup);
+ }
+}
Added: trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrWithKey.java
===================================================================
--- trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrWithKey.java (rev 0)
+++ trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrWithKey.java 2012-04-29 21:13:04 UTC (rev 3048)
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2012 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.btreeplus.service;
+
+import net.sf.joafip.NoStorableAccess;
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.TestException;
+import net.sf.joafip.kvstore.entity.HeapFileSetup;
+import net.sf.joafip.kvstore.service.AbstractTesDataMgrWithKey;
+import net.sf.joafip.kvstore.service.HeapException;
+import net.sf.joafip.kvstore.service.IHeapDataManager;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+@NoStorableAccess
+public class TestBtreePlusDataMgrWithKey extends AbstractTesDataMgrWithKey {
+
+ public TestBtreePlusDataMgrWithKey() throws TestException {
+ super();
+ }
+
+ public TestBtreePlusDataMgrWithKey(final String name) throws TestException {
+ super(name);
+ }
+
+ @Override
+ protected IHeapDataManager createHeapDataManager(final HeapFileSetup setup)
+ throws HeapException {
+ return new BtreePlusDataManager(setup);
+ }
+
+ @Override
+ protected void createHeap(final boolean removeFile) throws HeapException {
+ // not implemented
+ }
+
+ @Override
+ protected boolean manageFreeRecord() {
+ // not implemented
+ return false;
+ }
+}
Added: trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrWithScenario.java
===================================================================
--- trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrWithScenario.java (rev 0)
+++ trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrWithScenario.java 2012-04-29 21:13:04 UTC (rev 3048)
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2010 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.btreeplus.service;
+
+import net.sf.joafip.DoNotTransform;
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.TestException;
+import net.sf.joafip.kvstore.entity.HeapFileSetup;
+import net.sf.joafip.kvstore.service.AbstractTestDataMgrWithScenario;
+import net.sf.joafip.kvstore.service.HeapException;
+import net.sf.joafip.kvstore.service.IHeapDataManager;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+@DoNotTransform
+public class TestBtreePlusDataMgrWithScenario extends
+ AbstractTestDataMgrWithScenario {
+
+ public TestBtreePlusDataMgrWithScenario() throws TestException {
+ super();
+ }
+
+ public TestBtreePlusDataMgrWithScenario(final String name)
+ throws TestException {
+ super(name);
+ }
+
+ @Override
+ protected IHeapDataManager createHeapDataManager(final HeapFileSetup setup)
+ throws HeapException {
+ return new BtreePlusDataManager(setup);
+ }
+
+ @Override
+ protected void createHeap(final boolean removeFile) throws HeapException {
+ createFileHeapDataManager(removeFile);
+ }
+
+ @Override
+ protected boolean manageFreeRecord() {
+ return true;
+ }
+
+ @Override
+ protected void checkIntegrity() throws HeapException {
+ }
+}
Deleted: trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/service/AbstractDataRecordKeyComparator.java
===================================================================
--- trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/service/AbstractDataRecordKeyComparator.java 2012-04-29 20:16:53 UTC (rev 3047)
+++ trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/service/AbstractDataRecordKeyComparator.java 2012-04-29 21:13:04 UTC (rev 3048)
@@ -1,59 +0,0 @@
-/*
- * Copyright 2012 Luc Peuvrier
- *
- * This file is a part of JOAFIP.
- *
- * JOAFIP is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License.
- *
- * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
- * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl.html
- *
- * JOAFIP is distributed in the hope that it will be useful, but
- * unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.joafip.heapfile.record.service;
-
-import java.util.Comparator;
-
-import net.sf.joafip.NotStorableClass;
-import net.sf.joafip.kvstore.record.entity.IDataRecordKey;
-import net.sf.joafip.kvstore.record.service.IDataRecordKeyManager;
-import net.sf.joafip.kvstore.service.HeapException;
-
-/**
- *
- * @author luc peuvrier
- *
- * @param <K>
- */
-@NotStorableClass
-public abstract class AbstractDataRecordKeyComparator<K extends Comparable<K>>
- implements IDataRecordKeyManager {
-
- private final Comparator<? super K> comparator;
-
- public AbstractDataRecordKeyComparator(
- final Comparator<? super K> comparator) {
- super();
- this.comparator = comparator;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public int compareDataRecordKey(final IDataRecordKey dataRecordKey1,
- final IDataRecordKey dataRecordKey2) throws HeapException {
- final K key1 = (K) dataRecordKey1.getKey();
- final K key2 = (K) dataRecordKey2.getKey();
- return comparator == null ? key1.compareTo(key2) : comparator.compare(
- key1, key2);
- }
-}
Deleted: trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/service/DataRecordKeyManager.java
===================================================================
--- trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/service/DataRecordKeyManager.java 2012-04-29 20:16:53 UTC (rev 3047)
+++ trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/service/DataRecordKeyManager.java 2012-04-29 21:13:04 UTC (rev 3048)
@@ -1,93 +0,0 @@
-/*
- * Copyright 2012 Luc Peuvrier
- *
- * This file is a part of JOAFIP.
- *
- * JOAFIP is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License.
- *
- * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
- * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl.html
- *
- * JOAFIP is distributed in the hope that it will be useful, but
- * unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.joafip.heapfile.record.service;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.Comparator;
-
-import net.sf.joafip.NotStorableClass;
-import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
-import net.sf.joafip.kvstore.record.entity.DataRecordKey;
-import net.sf.joafip.kvstore.service.HeapException;
-
-/**
- *
- * @author luc peuvrier
- *
- */
-@NotStorableClass
-@SuppressWarnings("rawtypes")
-public class DataRecordKeyManager extends AbstractDataRecordKeyComparator {
-
- private static final DataRecordKeyManager INSTANCE = new DataRecordKeyManager();
-
- public static DataRecordKeyManager getInstance() {
- return INSTANCE;
- }
-
- @SuppressWarnings("unchecked")
- private DataRecordKeyManager() {
- super(null);
- }
-
- @SuppressWarnings("unchecked")
- protected DataRecordKeyManager(final Comparator comparator) {
- super(comparator);
- }
-
- @Override
- public Comparable<?> unmarshall(final byte[] keyData) throws HeapException {
- try {
- final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
- keyData);
- final ObjectInputStream objectInputStream = new ObjectInputStream(
- byteArrayInputStream);
- final Object result = objectInputStream.readObject();
- objectInputStream.close();
- return (Comparable<?>) result;
- } catch (Exception exception) {
- throw new HeapException("unmarshalling key", exception);
- }
- }
-
- @Override
- public DataRecordIdentifier createKey(final Object key)
- throws HeapException {
- try {
- final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
- final ObjectOutputStream outputStream = new ObjectOutputStream(
- byteArrayOutputStream);
- outputStream.writeObject(key);
- outputStream.close();
- final byte[] keyData = byteArrayOutputStream.toByteArray();
- final DataRecordKey dataRecordKey = new DataRecordKey(this, keyData);
- dataRecordKey.setKey(key);
- return new DataRecordIdentifier(dataRecordKey);
- } catch (Exception exception) {
- throw new HeapException("creating key", exception);
- }
- }
-}
Modified: trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrMemoryLeak.java
===================================================================
--- trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrMemoryLeak.java 2012-04-29 20:16:53 UTC (rev 3047)
+++ trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrMemoryLeak.java 2012-04-29 21:13:04 UTC (rev 3048)
@@ -16,21 +16,17 @@
*/
package net.sf.joafip.heapfile.service;
-import net.sf.joafip.HelperMemoryUse;
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.TestException;
import net.sf.joafip.kvstore.entity.HeapFileSetup;
-import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
-import net.sf.joafip.kvstore.service.AbstractTestHeapDataManager;
+import net.sf.joafip.kvstore.service.AbstractTestDataMgrMemoryLeak;
import net.sf.joafip.kvstore.service.HeapException;
import net.sf.joafip.kvstore.service.IHeapDataManager;
@NotStorableClass
-public class TestHeapFileDataMgrMemoryLeak extends AbstractTestHeapDataManager {
+public class TestHeapFileDataMgrMemoryLeak extends
+ AbstractTestDataMgrMemoryLeak {
- private static final HelperMemoryUse helperMemoryUse = HelperMemoryUse // NOPMD
- .getInstance();
-
public TestHeapFileDataMgrMemoryLeak() throws TestException {
super();
}
@@ -66,25 +62,4 @@
throws HeapException {
return new HeapFileDataManager(setup, false);
}
-
- /**
- * NOTE jmv: very slow on Linux<br>
- * RESPONSE luc: on windows xp jvm to.<br>
- * because of a lot of data record wrote in file<br>
- * take 187 seconds Intel Core 2 Duo E6320 1.86GHz with sun 32 bits jvm<br>
- */
- public void test() throws HeapException { // NOPMD
- helperMemoryUse.log("start");
- for (int i = 0; i < 1000; i++) {
- final DataRecordIdentifier identifier = heapDataManager
- .getNewDataRecordIdentifier();
- final byte[] data = new byte[100];// NOPMD
- heapDataManager.writeDataRecord(identifier, data);
-
- heapDataManager.flush();
- if (i % 10 == 9) {
- helperMemoryUse.log("created " + (i + 1));
- }
- }
- }
}
Modified: trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrWithKey.java
===================================================================
--- trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrWithKey.java 2012-04-29 20:16:53 UTC (rev 3047)
+++ trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrWithKey.java 2012-04-29 21:13:04 UTC (rev 3048)
@@ -25,10 +25,8 @@
import net.sf.joafip.NoStorableAccess;
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.TestException;
-import net.sf.joafip.heapfile.record.service.DataRecordKeyManager;
import net.sf.joafip.kvstore.entity.HeapFileSetup;
-import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
-import net.sf.joafip.kvstore.service.AbstractTestHeapDataManager;
+import net.sf.joafip.kvstore.service.AbstractTesDataMgrWithKey;
import net.sf.joafip.kvstore.service.HeapException;
import net.sf.joafip.kvstore.service.IHeapDataManager;
@@ -39,7 +37,7 @@
*/
@NotStorableClass
@NoStorableAccess
-public class TestHeapFileDataMgrWithKey extends AbstractTestHeapDataManager {
+public class TestHeapFileDataMgrWithKey extends AbstractTesDataMgrWithKey {
public TestHeapFileDataMgrWithKey() throws TestException {
super();
@@ -65,20 +63,4 @@
// not implemented
return false;
}
-
- public void testUseAsAMap() throws HeapException {
- final DataRecordKeyManager keyManager = DataRecordKeyManager
- .getInstance();
- createFileHeapDataManager(true);
- heapDataManager.setDataRecordKeyComparator(keyManager);
- final DataRecordIdentifier keyA = keyManager.createKey("A");
- assertFalse("must not found 'A'", heapDataManager.hasDataRecord(keyA));
- final byte[] dataA = "valueA".getBytes();
- heapDataManager.writeDataRecord(keyA, dataA);
- assertTrue("must found 'A'", heapDataManager.hasDataRecord(keyA));
- final byte[] readDataA = heapDataManager.readDataRecord(keyA);
- assertNotNull("must read 'A' data", readDataA);
- assertEquals("bad value", "valueA", new String(readDataA));
- }
-
}
Modified: trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrWithScenario.java
===================================================================
--- trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrWithScenario.java 2012-04-29 20:16:53 UTC (rev 3047)
+++ trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrWithScenario.java 2012-04-29 21:13:04 UTC (rev 3048)
@@ -22,18 +22,11 @@
*/
package net.sf.joafip.heapfile.service;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
import net.sf.joafip.DoNotTransform;
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.TestException;
import net.sf.joafip.kvstore.entity.HeapFileSetup;
-import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
-import net.sf.joafip.kvstore.service.AbstractTestHeapDataManagerRecord;
+import net.sf.joafip.kvstore.service.AbstractTestDataMgrWithScenario;
import net.sf.joafip.kvstore.service.HeapException;
import net.sf.joafip.kvstore.service.IHeapDataManager;
@@ -45,7 +38,7 @@
@NotStorableClass
@DoNotTransform
public class TestHeapFileDataMgrWithScenario extends
- AbstractTestHeapDataManagerRecord {
+ AbstractTestDataMgrWithScenario {
public TestHeapFileDataMgrWithScenario() throws TestException {
super();
@@ -77,87 +70,4 @@
HeapFileDataManagerIntegrityChecker.getInstance().checkIntegrity(
heapDataManager);
}
-
- public void test1() throws NumberFormatException, HeapException,// NOPMD
- IOException {
- testFromFile("scenario1.txt");
- }
-
- private void testFromFile(final String fileName) throws HeapException,
- NumberFormatException, IOException {
- final String name = getClass().getPackage().getName().replace('.', '/')
- + "/" + fileName;
- final InputStream inputStream = ClassLoader
- .getSystemResourceAsStream(name);
- assertNotNull("resource " + name + " not found", inputStream);
- final BufferedReader reader = new BufferedReader(new InputStreamReader(
- inputStream));
-
- createHeap(true);
- String operation;
- while ((operation = reader.readLine()) != null) {// NOPMD
- final String[] opElt = operation.split(";");
- final String instruction = opElt[0];
- if ("read".equals(instruction)) {
- final DataRecordIdentifier dataRecordIdentifier =
- /**/new DataRecordIdentifier(Integer.parseInt(opElt[1]));// NOPMD
- final byte[] opData;
- if (opElt.length < 3) {
- opData = null;
- } else {
- opData = dataFromString(opElt[2]);
- }
- final byte[] read = heapDataManager
- .readDataRecord(dataRecordIdentifier);
- if (opData == null) {
- assertNull("bad data read\n" + dataToString(read), read);
- } else {
- assertTrue("bad data read\n" + dataToString(read), Arrays// NOPMD
- .equals(opData, read));
- }
- } else if ("new".equals(instruction)) {
- final DataRecordIdentifier dataRecordIdentifier =
- /**/new DataRecordIdentifier(Integer.parseInt(opElt[1]));// NOPMD
- final DataRecordIdentifier newId = heapDataManager
- .getNewDataRecordIdentifier();
- assertEquals("bad id created", dataRecordIdentifier, newId);
- } else if ("write".equals(instruction)) {
- final DataRecordIdentifier dataRecordIdentifier =
- /**/new DataRecordIdentifier(Integer.parseInt(opElt[1]));// NOPMD
- final byte[] opData = dataFromString(opElt[2]);
- heapDataManager.writeDataRecord(dataRecordIdentifier, opData);
- } else if ("flush".equals(instruction)) {
- heapDataManager.flush();
- HeapFileDataManagerIntegrityChecker.getInstance()
- .checkIntegrity(heapDataManager);
- }
- }
- closeHeap();
- reader.close();
- }
-
- private byte[] dataFromString(final String string) {
- final int length = string.length();
- final byte[] data;
- if (length == 0) {
- data = null;
- } else {
- data = new byte[length / 2];
- for (int index = 0; index < length; index += 2) {
- data[index / 2] = (byte) Integer.parseInt(
- string.substring(index, index + 2), 16);
- }
- }
- return data;
- }
-
- private String dataToString(final byte data[]) {
- final StringBuilder builder = new StringBuilder();
- if (data != null) {
- for (byte byteValue : data) {
- builder.append(String.format("%02X", (int) byteValue));
- }
- }
- return builder.toString();
- }
}
Deleted: trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/scenario1.txt
===================================================================
--- trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/scenario1.txt 2012-04-29 20:16:53 UTC (rev 3047)
+++ trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/scenario1.txt 2012-04-29 21:13:04 UTC (rev 3048)
@@ -1,145 +0,0 @@
-writeAlwaysEnable;false
-writeEnable;true
-read;0;
-new;0
-write;0;FFFFFF880000000000000000FFFFFF880000000000000000FFFFFF880000000000000000FFFFFF880000000000000000FFFFFF880000000000000000FFFFFF880000000000000000FFFFFF880000000000000000FFFFFFC000FFFFFFC600
-flush
-read;1;
-writeEnable;true
-new;1
-writeEnable;true
-new;2
-new;3
-write;1;FFFFFFC2FFFFFF80000000FFFFFFC10001FFFFFFC204000000FFFFFFC200000001FFFFFFC000FFFFFFC23AFFFFFFB41A3CFFFFFF880000000000000000FFFFFFC80000000000000002FFFFFFC200000001FFFFFF880000000000000000FFFFFF880000000000000000
-new;4
-new;5
-new;6
-write;2;FFFFFFC2FFFFFF80000001FFFFFFC10001FFFFFFC204000000FFFFFFC200000001FFFFFFC000FFFFFFC21513FFFFFFC040FFFFFFC80000000000000004FFFFFF880000000000000000FFFFFFC80000000000000005FFFFFF880000000000000000
-new;7
-new;8
-write;4;FFFFFFC2FFFFFF80000002FFFFFFC10001FFFFFFC204000000FFFFFFC200000001FFFFFFC000FFFFFFC2FFFFFF84FFFFFFD1FFFFFF9422FFFFFF880000000000000000FFFFFFC80000000000000007
-new;9
-write;5;FFFFFFC2FFFFFF80000003FFFFFFC10001FFFFFFC204000000FFFFFFC200000001FFFFFFC000FFFFFFC2FFFFFFB75CFFFFFFBE29FFFFFFC80000000000000002
-new;10
-new;11
-new;12
-write;7;FFFFFFC2FFFFFF80000004FFFFFFC10001FFFFFFC204000000FFFFFFC200000001FFFFFFC000FFFFFFC2FFFFFF87FFFFFF8465FFFFFFB3FFFFFF880000000000000000FFFFFFC8000000000000000AFFFFFFC8000000000000000BFFFFFFC601FFFFFFC600FFFFFFC200000000FFFFFF880000000000000000
-new;13
-write;10;FFFFFFC2FFFFFF80000005FFFFFFC10001FFFFFFC204000000FFFFFFC200000001FFFFFFC000FFFFFFC2FFFFFFE0FFFFFFCBFFFFFFD76EFFFFFF880000000000000000
-new;14
-write;11;FFFFFFC2FFFFFF80000006FFFFFFC10001FFFFFFC204000000FFFFFFC200000001FFFFFFC000FFFFFFC207FFFFFF944374FFFFFFC8000000000000000AFFFFFFC601FFFFFFC601
-write;0;FFFFFF880000000000000000FFFFFF880000000000000000FFFFFF880000000000000000FFFFFFC8000000000000000EFFFFFF880000000000000000FFFFFF880000000000000000FFFFFF880000000000000000FFFFFFC000FFFFFFC600
-write;3;FFFFFF...
[truncated message content] |
|
From: <luc...@us...> - 2012-05-01 07:39:11
|
Revision: 3053
http://joafip.svn.sourceforge.net/joafip/?rev=3053&view=rev
Author: luc_peuvrier
Date: 2012-05-01 07:39:04 +0000 (Tue, 01 May 2012)
Log Message:
-----------
WIP btree plus: tests OK : WIP check and optimization
Modified Paths:
--------------
trunk/joafip-4test/pom.xml
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java
trunk/joafip-4test/src/main/resources/log4j.properties
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/AbstractElement.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/DataBlockPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/FreePage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/HeaderPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/LeafPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/NonTerminalPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageRecord.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataManager.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusElementMgr.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/LeafPageTest.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/NonTerminalPageTest.java
Added Paths:
-----------
trunk/joafip-4test/jrat.xml
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractDeleter.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/CreateDeleteList.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlus.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java
Property Changed:
----------------
trunk/joafip-4test/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-01 07:39:12
|
Revision: 3053
http://joafip.svn.sourceforge.net/joafip/?rev=3053&view=rev
Author: luc_peuvrier
Date: 2012-05-01 07:39:04 +0000 (Tue, 01 May 2012)
Log Message:
-----------
WIP btree plus: tests OK : WIP check and optimization
Modified Paths:
--------------
trunk/joafip-4test/pom.xml
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java
trunk/joafip-4test/src/main/resources/log4j.properties
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/AbstractElement.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/DataBlockPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/FreePage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/HeaderPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/LeafPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/NonTerminalPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageRecord.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataManager.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusElementMgr.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/LeafPageTest.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/NonTerminalPageTest.java
Added Paths:
-----------
trunk/joafip-4test/jrat.xml
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractDeleter.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/CreateDeleteList.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlus.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java
Property Changed:
----------------
trunk/joafip-4test/
Property changes on: trunk/joafip-4test
___________________________________________________________________
Modified: svn:ignore
- target
.settings
.classpath
.project
runtime
logs
.pmd
lib
runtime_perf
+ target
.settings
.classpath
.project
runtime
logs
.pmd
lib
runtime_perf
jrat.output
Added: trunk/joafip-4test/jrat.xml
===================================================================
--- trunk/joafip-4test/jrat.xml (rev 0)
+++ trunk/joafip-4test/jrat.xml 2012-05-01 07:39:04 UTC (rev 3053)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jrat>
+ <settings>
+ <property name="httpServerEnabled" value="false"/>
+ </settings>
+
+ <profile name="my code">
+
+ <criteria>
+ <include/>
+ </criteria>
+
+ <handlers>
+
+ <handler factory="org.shiftone.jrat.provider.tree.TreeMethodHandlerFactory">
+ <property name="outputFile" value="joafip.jrat"/>
+ </handler>
+
+ </handlers>
+
+ </profile>
+</jrat>
\ No newline at end of file
Modified: trunk/joafip-4test/pom.xml
===================================================================
--- trunk/joafip-4test/pom.xml 2012-04-30 05:17:03 UTC (rev 3052)
+++ trunk/joafip-4test/pom.xml 2012-05-01 07:39:04 UTC (rev 3053)
@@ -51,6 +51,12 @@
<dependency>
<groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-btreeplus</artifactId>
+ <version>4.0.0b8</version>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
<artifactId>joafip-rbtree</artifactId>
<version>4.0.0b8</version>
</dependency>
Added: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractDeleter.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractDeleter.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractDeleter.java 2012-05-01 07:39:04 UTC (rev 3053)
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2012 Luc Peuvrier
+ * All rights reserved.
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.performance.items.service;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+
+import net.sf.joafip.entity.EnumFilePersistenceCloseAction;
+import net.sf.joafip.kvstore.service.IHeapDataManager;
+import net.sf.joafip.performance.items.entity.Item;
+import net.sf.joafip.performance.items.entity.ItemList;
+import net.sf.joafip.service.FilePersistenceClassNotFoundException;
+import net.sf.joafip.service.FilePersistenceDataCorruptedException;
+import net.sf.joafip.service.FilePersistenceException;
+import net.sf.joafip.service.FilePersistenceInvalidClassException;
+import net.sf.joafip.service.FilePersistenceNotSerializableException;
+import net.sf.joafip.service.FilePersistenceTooBigForSerializationException;
+import net.sf.joafip.service.IDataAccessSession;
+import net.sf.joafip.store.service.StoreClassNotFoundException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public class AbstractDeleter extends AbstractPerfService {
+
+ public AbstractDeleter(final IHeapDataManager dataManager)
+ throws FilePersistenceInvalidClassException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceDataCorruptedException, FilePersistenceException,
+ FilePersistenceTooBigForSerializationException {
+ super(dataManager);
+ }
+
+ public AbstractDeleter(final String pathName)
+ throws FilePersistenceException,
+ FilePersistenceInvalidClassException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceDataCorruptedException, StoreClassNotFoundException,
+ FilePersistenceTooBigForSerializationException {
+ super(pathName);
+ }
+
+ protected void run() throws FilePersistenceException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceInvalidClassException,
+ FilePersistenceDataCorruptedException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceTooBigForSerializationException, IOException {
+ final IDataAccessSession session = filePersistence
+ .createDataAccessSession();
+ session.open();
+ int batchCount = 0;
+ int count = 0;
+ BufferedReader reader = new BufferedReader(new FileReader(
+ "runtime_perf/toDelete.txt"));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ final int identifier = Integer.parseInt(line);
+ final ItemList itemList = getItemList(session);
+ final Item item = itemList.removeItem(identifier);
+ if (item == null) {
+ throw new FilePersistenceException("must found #" + identifier
+ + " to be deleted");
+ }
+ if (++count == BATCH_SIZE) {
+ count = 0;
+ session.close(EnumFilePersistenceCloseAction.SAVE);
+ session.open();
+ ++batchCount;
+ logger.info("delete batch #" + batchCount);
+ }
+ }
+ reader.close();
+ session.close(EnumFilePersistenceCloseAction.SAVE);
+
+ session.open();
+ batchCount = 0;
+ count = 0;
+ reader = new BufferedReader(new FileReader("runtime_perf/toSearch.txt"));
+ while ((line = reader.readLine()) != null) {
+ final int identifier = Integer.parseInt(line);
+ final ItemList itemList = getItemList(session);
+ Item item = itemList.get(identifier);
+ if (item == null) {
+ throw new FilePersistenceException("must found #" + identifier
+ + " because not deleted");
+ }
+ if (++count == BATCH_SIZE) {
+ count = 0;
+ session.close(EnumFilePersistenceCloseAction.SAVE);
+ session.open();
+ ++batchCount;
+ logger.info("search batch #" + batchCount);
+ }
+ }
+ reader.close();
+ session.close(EnumFilePersistenceCloseAction.SAVE);
+
+ session.open();
+ batchCount = 0;
+ count = 0;
+ reader = new BufferedReader(new FileReader("runtime_perf/toDelete.txt"));
+ while ((line = reader.readLine()) != null) {
+ final int identifier = Integer.parseInt(line);
+ final ItemList itemList = getItemList(session);
+ final Item item = itemList.getItem(identifier);
+ if (item != null) {
+ throw new FilePersistenceException("must not found #"
+ + identifier + " because deleted");
+ }
+ if (++count == BATCH_SIZE) {
+ count = 0;
+ session.close(EnumFilePersistenceCloseAction.SAVE);
+ session.open();
+ ++batchCount;
+ logger.info("search deleted batch #" + batchCount);
+ }
+ }
+ reader.close();
+ session.close(EnumFilePersistenceCloseAction.SAVE);
+ }
+}
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java 2012-04-30 05:17:03 UTC (rev 3052)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java 2012-05-01 07:39:04 UTC (rev 3053)
@@ -53,15 +53,15 @@
protected static final int BATCH_SIZE = 1000;
- protected static final int NUMBER_OF_ITEM = 1000000;
+ public static final int NUMBER_OF_ITEM = 1000000;
- private static final boolean CRASH_SAFE_MODE = false;
+ protected static final boolean CRASH_SAFE_MODE = false;
private static final boolean GARBAGE = false;
protected static final boolean FILE_CACHE = true;
- private static final int PAGE_SIZE = 4 * 1024;
+ protected static final int PAGE_SIZE = 4 * 1024;
protected static final int NUMBER_OF_PAGE = 4 * 1024;
Added: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/CreateDeleteList.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/CreateDeleteList.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/CreateDeleteList.java 2012-05-01 07:39:04 UTC (rev 3053)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2012 Luc Peuvrier
+ * All rights reserved.
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.performance.items.service;
+
+import java.io.PrintWriter;
+import java.util.List;
+import java.util.Random;
+
+import net.sf.joafip.java.util.PTreeList;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public class CreateDeleteList {
+
+ public static void main(String[] args) {
+ try {
+ final List<Integer> list = new PTreeList<Integer>();
+ for (int identifier = 0; identifier < AbstractPerfService.NUMBER_OF_ITEM; identifier++) {
+ list.add(identifier);
+ }
+ PrintWriter writer = new PrintWriter("runtime_perf/toDelete.txt");
+ final Random random = new Random(System.currentTimeMillis());
+ for (int count = 0; count < AbstractPerfService.NUMBER_OF_ITEM / 2; count++) {
+ final int upperBound = list.size();
+ final int index = random.nextInt(upperBound);
+ int identifier = list.remove(index);
+ writer.println(identifier);
+ }
+ writer.close();
+ writer = new PrintWriter("runtime_perf/toSearch.txt");
+ for (int identifier : list) {
+ writer.println(identifier);
+ }
+ writer.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
Added: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java 2012-05-01 07:39:04 UTC (rev 3053)
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2012 Luc Peuvrier
+ * All rights reserved.
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.performance.items.service;
+
+import java.io.File;
+
+import net.sf.joafip.btreeplus.service.BtreePlusDataManager;
+import net.sf.joafip.kvstore.entity.HeapFileSetup;
+import net.sf.joafip.kvstore.service.IHeapDataManager;
+import net.sf.joafip.logger.JoafipLogger;
+import net.sf.joafip.service.FilePersistenceClassNotFoundException;
+import net.sf.joafip.service.FilePersistenceDataCorruptedException;
+import net.sf.joafip.service.FilePersistenceException;
+import net.sf.joafip.service.FilePersistenceInvalidClassException;
+import net.sf.joafip.service.FilePersistenceNotSerializableException;
+import net.sf.joafip.service.FilePersistenceTooBigForSerializationException;
+import net.sf.joafip.store.service.StoreClassNotFoundException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public class DeleterBtreePlus extends AbstractDeleter {
+
+ private final static JoafipLogger LOGGER = JoafipLogger
+ .getLogger(DeleterBtreePlus.class);
+
+ public DeleterBtreePlus(final IHeapDataManager dataManager)
+ throws FilePersistenceInvalidClassException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceDataCorruptedException, FilePersistenceException,
+ FilePersistenceTooBigForSerializationException {
+ super(dataManager);
+ }
+
+ public DeleterBtreePlus(final String pathName)
+ throws FilePersistenceException,
+ FilePersistenceInvalidClassException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceDataCorruptedException, StoreClassNotFoundException,
+ FilePersistenceTooBigForSerializationException {
+ super(pathName);
+ }
+
+ public static void main(final String[] args) {
+ final String dataFilePath = RUNTIME_DIR + "/block.data";
+ final File dataFile = new File(dataFilePath);
+ DeleterBtreePlus deleter;
+ try {
+ final HeapFileSetup setup = new HeapFileSetup(dataFile,
+ CRASH_SAFE_MODE/* crashSafeMode */,
+ false/* FILE_CACHE *//* useCacheMode */,
+ false/* deleteRenaming */, false/* clearResizeFile */,
+ 0/* maxFileOperationRetry */,
+ 0/* fileOperationRetryMsDelay */, null/* openFileTraceFile */);
+ // if (FILE_CACHE) {
+ // setup.cacheSetup(PAGE_SIZE, NUMBER_OF_PAGE);
+ // }
+ final IHeapDataManager dataManager =
+ /**/new BtreePlusDataManager(setup);
+ deleter = new DeleterBtreePlus(dataManager);
+ deleter.run();
+ } catch (final Throwable throwable) {// NOPMD catch all
+ LOGGER.fatal("error", throwable);
+ }
+ }
+}
Added: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlus.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlus.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlus.java 2012-05-01 07:39:04 UTC (rev 3053)
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.performance.items.service;//NOPMD
+
+import java.io.File;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.StorableAccess;
+import net.sf.joafip.btreeplus.service.BtreePlusDataManager;
+import net.sf.joafip.kvstore.entity.HeapFileSetup;
+import net.sf.joafip.kvstore.service.IHeapDataManager;
+import net.sf.joafip.logger.JoafipLogger;
+import net.sf.joafip.service.FilePersistenceClassNotFoundException;
+import net.sf.joafip.service.FilePersistenceDataCorruptedException;
+import net.sf.joafip.service.FilePersistenceException;
+import net.sf.joafip.service.FilePersistenceInvalidClassException;
+import net.sf.joafip.service.FilePersistenceNotSerializableException;
+import net.sf.joafip.service.FilePersistenceTooBigForSerializationException;
+import net.sf.joafip.store.service.StoreClassNotFoundException;
+
+@SuppressWarnings("PMD")
+@NotStorableClass
+@StorableAccess
+public final class InserterBtreePlus extends AbstractInserter {
+
+ private static final JoafipLogger LOGGER = JoafipLogger
+ .getLogger(InserterBtreePlus.class);
+
+ private InserterBtreePlus(final String pathName)
+ throws FilePersistenceException,
+ FilePersistenceInvalidClassException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceDataCorruptedException, StoreClassNotFoundException,
+ FilePersistenceTooBigForSerializationException {
+ super(pathName);
+ }
+
+ private InserterBtreePlus(final IHeapDataManager dataManager)
+ throws FilePersistenceInvalidClassException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceDataCorruptedException, FilePersistenceException,
+ FilePersistenceTooBigForSerializationException {
+ super(dataManager);
+ }
+
+ public static void main(final String[] args) {
+ /* remove existing data */
+ final File dataDirectory = new File(RUNTIME_DIR);
+ for (final File file : dataDirectory.listFiles()) {
+ file.delete();
+ }
+ dataDirectory.mkdirs();
+ final String dataFilePath = RUNTIME_DIR + "/block.data";
+ /* remove existing data */
+ final File dataFile = new File(dataFilePath);
+ dataFile.delete();
+ InserterBtreePlus inserter;
+ try {
+ final HeapFileSetup setup = new HeapFileSetup(dataFile,
+ CRASH_SAFE_MODE/* crashSafeMode */,
+ false/* FILE_CACHE *//* useCacheMode */,
+ false/* deleteRenaming */, false/* clearResizeFile */,
+ 0/* maxFileOperationRetry */,
+ 0/* fileOperationRetryMsDelay */, null/* openFileTraceFile */);
+ // if (FILE_CACHE) {
+ // setup.cacheSetup(PAGE_SIZE, NUMBER_OF_PAGE);
+ // }
+ final IHeapDataManager dataManager =
+ /**/new BtreePlusDataManager(setup);
+ inserter = new InserterBtreePlus(dataManager);
+ inserter.run(NUMBER_OF_ITEM);
+ inserter.close();
+ } catch (final Throwable throwable) {// NOPMD catch all
+ LOGGER.fatal("error", throwable);
+ }
+ }
+}
Added: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java 2012-05-01 07:39:04 UTC (rev 3053)
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2007 Luc Peuvrier
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.performance.items.service;
+
+import java.io.File;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.StorableAccess;
+import net.sf.joafip.btreeplus.service.BtreePlusDataManager;
+import net.sf.joafip.kvstore.entity.HeapFileSetup;
+import net.sf.joafip.kvstore.service.IHeapDataManager;
+import net.sf.joafip.logger.JoafipLogger;
+import net.sf.joafip.service.FilePersistenceClassNotFoundException;
+import net.sf.joafip.service.FilePersistenceDataCorruptedException;
+import net.sf.joafip.service.FilePersistenceException;
+import net.sf.joafip.service.FilePersistenceInvalidClassException;
+import net.sf.joafip.service.FilePersistenceNotSerializableException;
+import net.sf.joafip.service.FilePersistenceTooBigForSerializationException;
+import net.sf.joafip.store.service.StoreClassNotFoundException;
+
+@NotStorableClass
+@StorableAccess
+public class SearcherBtreePlus extends AbstractSearcher {
+
+ private static final JoafipLogger LOGGER = JoafipLogger
+ .getLogger(SearcherBtreePlus.class);
+
+ public SearcherBtreePlus(final String pathName)
+ throws FilePersistenceException,
+ FilePersistenceInvalidClassException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceDataCorruptedException, StoreClassNotFoundException,
+ FilePersistenceTooBigForSerializationException {
+ super(pathName);
+ }
+
+ public SearcherBtreePlus(final IHeapDataManager dataManager)
+ throws FilePersistenceInvalidClassException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceDataCorruptedException, FilePersistenceException,
+ FilePersistenceTooBigForSerializationException {
+ super(dataManager);
+ }
+
+ public static void main(final String[] args) {
+ final String dataFilePath = RUNTIME_DIR + "/block.data";
+ final File dataFile = new File(dataFilePath);
+ SearcherBtreePlus searcher;
+ try {
+ final HeapFileSetup setup = new HeapFileSetup(dataFile,
+ CRASH_SAFE_MODE/* crashSafeMode */,
+ false/* FILE_CACHE *//* useCacheMode */,
+ false/* deleteRenaming */, false/* clearResizeFile */,
+ 0/* maxFileOperationRetry */,
+ 0/* fileOperationRetryMsDelay */, null/* openFileTraceFile */);
+ // if (FILE_CACHE) {
+ // setup.cacheSetup(PAGE_SIZE, NUMBER_OF_PAGE);
+ // }
+ final IHeapDataManager dataManager =
+ /**/new BtreePlusDataManager(setup);
+ searcher = new SearcherBtreePlus(dataManager);
+ searcher.run();
+ } catch (final Throwable throwable) {// NOPMD catch all
+ LOGGER.fatal("error", throwable);
+ }
+ }
+}
Modified: trunk/joafip-4test/src/main/resources/log4j.properties
===================================================================
--- trunk/joafip-4test/src/main/resources/log4j.properties 2012-04-30 05:17:03 UTC (rev 3052)
+++ trunk/joafip-4test/src/main/resources/log4j.properties 2012-05-01 07:39:04 UTC (rev 3053)
@@ -130,11 +130,16 @@
log4j.logger.net.sf.joafip.performance.items.service.InserterBKM=info
log4j.logger.net.sf.joafip.performance.items.service.InserterJdbm=info
log4j.logger.net.sf.joafip.performance.items.service.InserterBabuDB=info
+log4j.logger.net.sf.joafip.performance.items.service.InserterBtreePlus=info
log4j.logger.net.sf.joafip.performance.items.service.Searcher=info
log4j.logger.net.sf.joafip.performance.items.service.SearcherBKM=info
log4j.logger.net.sf.joafip.performance.items.service.SearcherJdbm=info
log4j.logger.net.sf.joafip.performance.items.service.ImportSearcher=info
+log4j.logger.net.sf.joafip.performance.items.service.SearcherBtreePlus=info
+
+log4j.logger.net.sf.joafip.performance.items.service.DeleterBtreePlus=info
+
log4j.logger.net.sf.joafip.service.MainCrash=info
log4j.logger.net.sf.joafip.service.MainAfterCrash=info
log4j.logger.net.sf.joafip.service.MainWarnDataRecord1=debug
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/AbstractElement.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/AbstractElement.java 2012-04-30 05:17:03 UTC (rev 3052)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/AbstractElement.java 2012-05-01 07:39:04 UTC (rev 3053)
@@ -66,6 +66,10 @@
return pageRecord.getPositionInFile();
}
+ public long getPreviousRecordPositionInFile() throws HeapException {
+ return pageRecord.getPreviousRecordPositionInFile();
+ }
+
protected int entrySize(final DataRecordIdentifier key) {
int entryByteSize = 8/* long size for pointer */+ 8/* long size for value */;
final int dataSize = key.getKeyDataSize();
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/DataBlockPage.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/DataBlockPage.java 2012-04-30 05:17:03 UTC (rev 3052)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/DataBlockPage.java 2012-05-01 07:39:04 UTC (rev 3053)
@@ -35,6 +35,7 @@
public class DataBlockPage extends AbstractElement {
public static final int HEAD_SIZE =
+ /**/8/* byte size for previous record position */+
/**/1/* byte size for record type */+
/**/1/* byte size for bits */;
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/FreePage.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/FreePage.java 2012-04-30 05:17:03 UTC (rev 3052)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/FreePage.java 2012-05-01 07:39:04 UTC (rev 3053)
@@ -59,7 +59,9 @@
@Override
public int getByteSize() {
// return PageConstant.PAGE_SIZE;
- return 1/* byte size for record type */+
+ return
+ /**/8/* byte size for previous record position */+
+ /**/1/* byte size for record type */+
/**/8/* long size for next free page */+
/**/4/* int size for crc32 */;
}
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/HeaderPage.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/HeaderPage.java 2012-04-30 05:17:03 UTC (rev 3052)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/HeaderPage.java 2012-05-01 07:39:04 UTC (rev 3053)
@@ -48,6 +48,8 @@
private long nextDataRecordIdentifier;
+ private long lastRecordPositionInFile;
+
public HeaderPage(final IHeapElementManager heapElementManager) {
super(heapElementManager, 0L);
}
@@ -106,6 +108,7 @@
rootPagePosition = -1L;
freeDataBlocks = null;
nextDataRecordIdentifier = 0;
+ lastRecordPositionInFile = -1L;
}
@Override
@@ -140,6 +143,7 @@
writeLong(pageNumberOfFirstFreePage);
writeLong(rootPagePosition);
writeLong(nextDataRecordIdentifier);
+ writeLong(lastRecordPositionInFile);
initializeFreeDataBlock();
for (int index = 0; index < PageConstant.NUMBER_OF_BLOCK_TYPE; index++) {
writeLong(freeDataBlocks[index]);
@@ -163,6 +167,7 @@
pageNumberOfFirstFreePage = readLong();
rootPagePosition = readLong();
nextDataRecordIdentifier = readLong();
+ lastRecordPositionInFile = readLong();
initializeFreeDataBlock();
for (int index = 0; index < PageConstant.NUMBER_OF_BLOCK_TYPE; index++) {
freeDataBlocks[index] = readLong();
@@ -241,4 +246,12 @@
public int getInParentIndex() throws HeapException {
throw new HeapException("unsupported");
}
+
+ public void setLastRecordPositionInFile(final long lastRecordPositionInFile) {
+ this.lastRecordPositionInFile = lastRecordPositionInFile;
+ }
+
+ public long getLastRecordPositionInFile() {
+ return lastRecordPositionInFile;
+ }
}
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/LeafPage.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/LeafPage.java 2012-04-30 05:17:03 UTC (rev 3052)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/...
[truncated message content] |
|
From: <luc...@us...> - 2012-05-01 21:05:45
|
Revision: 3058
http://joafip.svn.sourceforge.net/joafip/?rev=3058&view=rev
Author: luc_peuvrier
Date: 2012-05-01 21:05:38 +0000 (Tue, 01 May 2012)
Log Message:
-----------
file cache optimization
Modified Paths:
--------------
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCache.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCacheTest.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManagerFactory.java
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCache.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCache.java 2012-05-01 20:02:42 UTC (rev 3057)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCache.java 2012-05-01 21:05:38 UTC (rev 3058)
@@ -209,6 +209,9 @@
previousPagePositionInfile = pagePositionInfile;
}
}
+ if (!haveReadCache) {
+ cacheMap.clear();
+ }
}
@Override
Modified: trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCacheTest.java
===================================================================
--- trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCacheTest.java 2012-05-01 20:02:42 UTC (rev 3057)
+++ trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCacheTest.java 2012-05-01 21:05:38 UTC (rev 3058)
@@ -197,27 +197,43 @@
+ randomFileAccess.getPageSet().toString());
}
- assertEquals(BAD_READ_ACCESS + '\n' + probe.readLogToString(), 5,
- probe.readLogSize());
- assertEquals(BAD_WRITE_ACCESS, 0, probe.writeLogSize());
+ if (flushMode) {
+ // data kept in cache
+ assertEquals(BAD_READ_ACCESS + '\n' + probe.readLogToString(), 2,
+ probe.readLogSize());
+ assertEquals(BAD_WRITE_ACCESS, 0, probe.writeLogSize());
+ record = probe.pollFirstRead();
+ assertEquals(BAD_POSITION_IN_FILE, 3 * PAGE_SIZE,
+ record.getPositionInFile());
+ assertEquals(BAD_DATA, createStrPageData('3'), record.getStrData());
+ record = probe.pollFirstRead();
+ assertEquals(BAD_POSITION_IN_FILE, 4 * PAGE_SIZE,
+ record.getPositionInFile());
+ assertEquals(BAD_DATA, createStrPageData('4'), record.getStrData());
+ } else {
+ // cache was cleared, so check read 5 records
+ assertEquals(BAD_READ_ACCESS + '\n' + probe.readLogToString(), 5,
+ probe.readLogSize());
+ assertEquals(BAD_WRITE_ACCESS, 0, probe.writeLogSize());
- record = probe.pollFirstRead();
- assertEquals(BAD_POSITION_IN_FILE, 0 * PAGE_SIZE,
- record.getPositionInFile());
- record = probe.pollFirstRead();
- assertEquals(BAD_POSITION_IN_FILE, 1 * PAGE_SIZE,
- record.getPositionInFile());
- record = probe.pollFirstRead();
- assertEquals(BAD_POSITION_IN_FILE, 2 * PAGE_SIZE,
- record.getPositionInFile());
- record = probe.pollFirstRead();
- assertEquals(BAD_POSITION_IN_FILE, 3 * PAGE_SIZE,
- record.getPositionInFile());
- assertEquals(BAD_DATA, createStrPageData('3'), record.getStrData());
- record = probe.pollFirstRead();
- assertEquals(BAD_POSITION_IN_FILE, 4 * PAGE_SIZE,
- record.getPositionInFile());
- assertEquals(BAD_DATA, createStrPageData('4'), record.getStrData());
+ record = probe.pollFirstRead();
+ assertEquals(BAD_POSITION_IN_FILE, 0 * PAGE_SIZE,
+ record.getPositionInFile());
+ record = probe.pollFirstRead();
+ assertEquals(BAD_POSITION_IN_FILE, 1 * PAGE_SIZE,
+ record.getPositionInFile());
+ record = probe.pollFirstRead();
+ assertEquals(BAD_POSITION_IN_FILE, 2 * PAGE_SIZE,
+ record.getPositionInFile());
+ record = probe.pollFirstRead();
+ assertEquals(BAD_POSITION_IN_FILE, 3 * PAGE_SIZE,
+ record.getPositionInFile());
+ assertEquals(BAD_DATA, createStrPageData('3'), record.getStrData());
+ record = probe.pollFirstRead();
+ assertEquals(BAD_POSITION_IN_FILE, 4 * PAGE_SIZE,
+ record.getPositionInFile());
+ assertEquals(BAD_DATA, createStrPageData('4'), record.getStrData());
+ }
randomFileAccess.close();
}
Modified: trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManagerFactory.java
===================================================================
--- trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManagerFactory.java 2012-05-01 20:02:42 UTC (rev 3057)
+++ trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManagerFactory.java 2012-05-01 21:05:38 UTC (rev 3058)
@@ -76,7 +76,7 @@
/* no read cache on backup copy, not used for read */
fileForStorableBackup = new FileForStorable(
setup.getBackupDataFile(), setup.getPageSize(),
- setup.getMaxPage(), false, maxFileOperationRetry,
+ setup.getMaxPage(), false/*no read cache*/, maxFileOperationRetry,
fileOperationRetryMsDelay);
stateOkFlagFile = setup.getStateOkFlagFile();
} else {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-01 21:05:45
|
Revision: 3058
http://joafip.svn.sourceforge.net/joafip/?rev=3058&view=rev
Author: luc_peuvrier
Date: 2012-05-01 21:05:38 +0000 (Tue, 01 May 2012)
Log Message:
-----------
file cache optimization
Modified Paths:
--------------
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCache.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCacheTest.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManagerFactory.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-01 21:55:22
|
Revision: 3059
http://joafip.svn.sourceforge.net/joafip/?rev=3059&view=rev
Author: luc_peuvrier
Date: 2012-05-01 21:55:15 +0000 (Tue, 01 May 2012)
Log Message:
-----------
refactoring
Modified Paths:
--------------
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/AbstractHeapRBTNode.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManagerFactory.java
Modified: trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/AbstractHeapRBTNode.java
===================================================================
--- trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/AbstractHeapRBTNode.java 2012-05-01 21:05:38 UTC (rev 3058)
+++ trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/AbstractHeapRBTNode.java 2012-05-01 21:55:15 UTC (rev 3059)
@@ -116,21 +116,6 @@
this.numberOfChild = numberOfChild;
}
- // /**
- // * construct a Red Black Tree node mirrored in heap file
- // *
- // * @param heapElementManager
- // * the heap element manager
- // * @param heapRecord
- // * associated heap record
- // */
- // public AbstractHeapRBTNode(final IHeapElementManager heapElementManager,
- // final long positionInFile) {
- // super();
- // this.heapElementManager = heapElementManager;
- // this.positionInFile = positionInFile;
- // }
-
public HeapRecord getHeapRecord() throws HeapException {
return readHeapFileDataRecord(positionInFile);
}
Modified: trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java
===================================================================
--- trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java 2012-05-01 21:05:38 UTC (rev 3058)
+++ trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java 2012-05-01 21:55:15 UTC (rev 3059)
@@ -516,8 +516,9 @@
public void clear() throws HeapException {
// ASSERTX
assert assertTransactionOpened();
- heapRecordToWriteMap.clear();
- readHeapRecordMap.clear();
+
+ clearHeaprecordMaps();
+
if (clearResizeFile) {
try {
setStartSaveFlagFile();
@@ -562,7 +563,7 @@
starterTrace = new Exception("starter trace");
serviceStarted = true;
if (!fileOpenedInTransaction) {
- openFile();
+ openFiles();
}
}
@@ -618,10 +619,11 @@
// ASSERTX
assert assertServiceStartedAndTransactionClosed();
if (fileOpenedInTransaction) {
- openFile();
+ openFiles();
}
- clearHeaprecordToWriteMap();
- readHeapRecordMap.clear();
+
+ clearHeaprecordMaps();
+
try {
final long fileSize = getFileSize();
header.clear();
@@ -632,7 +634,7 @@
flushOnFile();
if (fileOpenedInTransaction) {
closeFiles();
- openFile();
+ openFiles();
}
} else {
header.readFromFile();
@@ -666,7 +668,7 @@
return true;
}
- private void openFile() throws HeapException {
+ private void openFiles() throws HeapException {
if (openFileTraceFile != null) {
try {
final PrintStream printStream = new PrintStream(
@@ -713,8 +715,8 @@
updateBackup(toBackupList);
- clearHeaprecordToWriteMap();
- readHeapRecordMap.clear();
+ clearHeaprecordMaps();
+
if (crashSafeMode) {
flushOnFile();
}
@@ -728,16 +730,26 @@
public void closeTransactionDiscardChange() throws HeapException {
// ASSERTX
assert assertTransactionOpened();
- clearHeaprecordToWriteMap();
- readHeapRecordMap.clear();
+
+ clearHeaprecordMaps();
+
if (fileOpenedInTransaction) {
closeFiles();
}
openedTransaction = false;
}
- private void clearHeaprecordToWriteMap() {
+ // private void clearHeaprecordReadMap() {
+ // readHeapRecordMap.clear();
+ // }
+ //
+ // private void clearHeaprecordToWriteMap() {
+ // heapRecordToWriteMap.clear();
+ // }
+
+ private void clearHeaprecordMaps() {
heapRecordToWriteMap.clear();
+ readHeapRecordMap.clear();
}
private void closeFiles() throws HeapException {
@@ -1064,10 +1076,12 @@
// ASSERTX
assert assertNoPreviousOrPreviousSameAsCurrent(previous, heapRecord);
if (previous == null) {
+ // may be in read cache
previous = readHeapRecordMap.remove(positionInFile);
// ASSERTX
assert assertNoPreviousOrPreviousSameAsCurrent(previous, heapRecord);
} else {
+ // is not in read cache because already in write cache
// ASSERTX
assert !readHeapRecordMap.containsKey(positionInFile) : "heap record must not be in read cache";
}
Modified: trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManagerFactory.java
===================================================================
--- trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManagerFactory.java 2012-05-01 21:05:38 UTC (rev 3058)
+++ trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManagerFactory.java 2012-05-01 21:55:15 UTC (rev 3059)
@@ -76,8 +76,8 @@
/* no read cache on backup copy, not used for read */
fileForStorableBackup = new FileForStorable(
setup.getBackupDataFile(), setup.getPageSize(),
- setup.getMaxPage(), false/*no read cache*/, maxFileOperationRetry,
- fileOperationRetryMsDelay);
+ setup.getMaxPage(), false/* no read cache */,
+ maxFileOperationRetry, fileOperationRetryMsDelay);
stateOkFlagFile = setup.getStateOkFlagFile();
} else {
fileForStorable = new FileForStorable(setup.getDataFile(),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-01 21:55:22
|
Revision: 3059
http://joafip.svn.sourceforge.net/joafip/?rev=3059&view=rev
Author: luc_peuvrier
Date: 2012-05-01 21:55:15 +0000 (Tue, 01 May 2012)
Log Message:
-----------
refactoring
Modified Paths:
--------------
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/AbstractHeapRBTNode.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManagerFactory.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-03 03:36:57
|
Revision: 3063
http://joafip.svn.sourceforge.net/joafip/?rev=3063&view=rev
Author: luc_peuvrier
Date: 2012-05-03 03:36:50 +0000 (Thu, 03 May 2012)
Log Message:
-----------
refactoring best name
Modified Paths:
--------------
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/HeapFileCheckerDataManager.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/IHeapDataManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTesDataMgrWithKey.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/BlockDataManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/DualWrapDataManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/HeapMemoryDataManagerMock.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/HeapMultiFileDataManager.java
trunk/joafip-pmap/src/main/java/net/sf/joafip/pmap/FileTreeMap.java
Modified: trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java
===================================================================
--- trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java 2012-05-03 02:48:57 UTC (rev 3062)
+++ trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java 2012-05-03 03:36:50 UTC (rev 3063)
@@ -1093,7 +1093,7 @@
}
@Override
- public void setDataRecordKeyComparator(
+ public void setDataRecordKeyManager(
final IDataRecordKeyManager dataRecordKeyComparator) {
heapElementManager.setDataRecordKeyManager(dataRecordKeyComparator);
}
Modified: trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/HeapFileCheckerDataManager.java
===================================================================
--- trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/HeapFileCheckerDataManager.java 2012-05-03 02:48:57 UTC (rev 3062)
+++ trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/HeapFileCheckerDataManager.java 2012-05-03 03:36:50 UTC (rev 3063)
@@ -338,7 +338,7 @@
}
@Override
- public void setDataRecordKeyComparator(
+ public void setDataRecordKeyManager(
final IDataRecordKeyManager dataRecordKeyComparator) {
throw new UnsupportedOperationException(
"works only with long data record identifier");
Modified: trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/IHeapDataManager.java
===================================================================
--- trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/IHeapDataManager.java 2012-05-03 02:48:57 UTC (rev 3062)
+++ trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/IHeapDataManager.java 2012-05-03 03:36:50 UTC (rev 3063)
@@ -259,8 +259,8 @@
*/
void clearStandbyModification() throws HeapException;
- void setDataRecordKeyComparator(
- IDataRecordKeyManager dataRecordKeyComparator) throws HeapException;
+ void setDataRecordKeyManager(IDataRecordKeyManager dataRecordKeyComparator)
+ throws HeapException;
/**
* get number of data record in heap file.<br>
Modified: trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTesDataMgrWithKey.java
===================================================================
--- trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTesDataMgrWithKey.java 2012-05-03 02:48:57 UTC (rev 3062)
+++ trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTesDataMgrWithKey.java 2012-05-03 03:36:50 UTC (rev 3063)
@@ -50,7 +50,7 @@
final DataRecordKeyManager keyManager = DataRecordKeyManager
.getInstance();
createFileHeapDataManager(true);
- heapDataManager.setDataRecordKeyComparator(keyManager);
+ heapDataManager.setDataRecordKeyManager(keyManager);
final DataRecordIdentifier keyA = keyManager.createKey("A");
assertFalse("must not found 'A'", heapDataManager.hasDataRecord(keyA));
final byte[] dataA = "valueA".getBytes();
Modified: trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/BlockDataManager.java
===================================================================
--- trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/BlockDataManager.java 2012-05-03 02:48:57 UTC (rev 3062)
+++ trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/BlockDataManager.java 2012-05-03 03:36:50 UTC (rev 3063)
@@ -484,7 +484,7 @@
}
@Override
- public void setDataRecordKeyComparator(
+ public void setDataRecordKeyManager(
final IDataRecordKeyManager dataRecordKeyComparator) {
throw new UnsupportedOperationException(
"works only with long data record identifier");
Modified: trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/DualWrapDataManager.java
===================================================================
--- trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/DualWrapDataManager.java 2012-05-03 02:48:57 UTC (rev 3062)
+++ trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/DualWrapDataManager.java 2012-05-03 03:36:50 UTC (rev 3063)
@@ -361,10 +361,10 @@
}
@Override
- public void setDataRecordKeyComparator(
+ public void setDataRecordKeyManager(
final IDataRecordKeyManager dataRecordKeyComparator)
throws HeapException {
- firstDataManager.setDataRecordKeyComparator(dataRecordKeyComparator);
- secondDataManager.setDataRecordKeyComparator(dataRecordKeyComparator);
+ firstDataManager.setDataRecordKeyManager(dataRecordKeyComparator);
+ secondDataManager.setDataRecordKeyManager(dataRecordKeyComparator);
}
}
Modified: trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/HeapMemoryDataManagerMock.java
===================================================================
--- trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/HeapMemoryDataManagerMock.java 2012-05-03 02:48:57 UTC (rev 3062)
+++ trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/HeapMemoryDataManagerMock.java 2012-05-03 03:36:50 UTC (rev 3063)
@@ -297,7 +297,7 @@
}
@Override
- public void setDataRecordKeyComparator(
+ public void setDataRecordKeyManager(
final IDataRecordKeyManager dataRecordKeyComparator) {
throw new UnsupportedOperationException(
"works only with long data record identifier");
Modified: trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/HeapMultiFileDataManager.java
===================================================================
--- trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/HeapMultiFileDataManager.java 2012-05-03 02:48:57 UTC (rev 3062)
+++ trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/HeapMultiFileDataManager.java 2012-05-03 03:36:50 UTC (rev 3063)
@@ -468,7 +468,7 @@
}
@Override
- public void setDataRecordKeyComparator(
+ public void setDataRecordKeyManager(
final IDataRecordKeyManager dataRecordKeyComparator) {
throw new UnsupportedOperationException(
"works only with long data record identifier");
Modified: trunk/joafip-pmap/src/main/java/net/sf/joafip/pmap/FileTreeMap.java
===================================================================
--- trunk/joafip-pmap/src/main/java/net/sf/joafip/pmap/FileTreeMap.java 2012-05-03 02:48:57 UTC (rev 3062)
+++ trunk/joafip-pmap/src/main/java/net/sf/joafip/pmap/FileTreeMap.java 2012-05-03 03:36:50 UTC (rev 3063)
@@ -100,7 +100,7 @@
true/* manageNodeindex */, autoSaveMaxRecord.intValue());
}
keyManager = new FileTreeMapKeyMgr(comparator);
- heapDataManager.setDataRecordKeyComparator(keyManager);
+ heapDataManager.setDataRecordKeyManager(keyManager);
this.comparator = comparator;
this.descending = false;
this.fromKey = null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-03 03:36:57
|
Revision: 3063
http://joafip.svn.sourceforge.net/joafip/?rev=3063&view=rev
Author: luc_peuvrier
Date: 2012-05-03 03:36:50 +0000 (Thu, 03 May 2012)
Log Message:
-----------
refactoring best name
Modified Paths:
--------------
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/HeapFileCheckerDataManager.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/IHeapDataManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTesDataMgrWithKey.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/BlockDataManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/DualWrapDataManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/HeapMemoryDataManagerMock.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/HeapMultiFileDataManager.java
trunk/joafip-pmap/src/main/java/net/sf/joafip/pmap/FileTreeMap.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-04 17:54:09
|
Revision: 3068
http://joafip.svn.sourceforge.net/joafip/?rev=3068&view=rev
Author: luc_peuvrier
Date: 2012-05-04 17:54:02 +0000 (Fri, 04 May 2012)
Log Message:
-----------
WIP btree plus: tests OK : WIP check and optimization : write and read/check crc32 change
Modified Paths:
--------------
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/HeaderPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageRecord.java
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/HeapHeader.java
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/HeapRecord.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/AbstractFileStorable.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/RecordForTest.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/TestAbstractFileStorable.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/TestMarshall.java
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/HeaderPage.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/HeaderPage.java 2012-05-04 16:18:55 UTC (rev 3067)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/HeaderPage.java 2012-05-04 17:54:02 UTC (rev 3068)
@@ -148,7 +148,7 @@
for (int index = 0; index < PageConstant.NUMBER_OF_BLOCK_TYPE; index++) {
writeLong(freeDataBlocks[index]);
}
- writeCrc32();
+ writeCrc32(0);
}
@Override
@@ -172,7 +172,7 @@
for (int index = 0; index < PageConstant.NUMBER_OF_BLOCK_TYPE; index++) {
freeDataBlocks[index] = readLong();
}
- readAndCheckCrc32();
+ readAndCheckCrc32(0);
}
private void initializeFreeDataBlock() {
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageRecord.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageRecord.java 2012-05-04 16:18:55 UTC (rev 3067)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageRecord.java 2012-05-04 17:54:02 UTC (rev 3068)
@@ -204,7 +204,7 @@
writeKey(nonTerminalPage.getKey(index));
}
writeLong(nonTerminalPage.getPagePointer(numberOfKeyEntries));
- writeCrc32();
+ writeCrc32(0);
}
private void unmarshallNonTerminalPage() throws HeapException {
@@ -219,7 +219,7 @@
}
final long pagePointer = readLong();
nonTerminalPage.setEntry(numberOfKeyEntries, pagePointer, null);
- readAndCheckCrc32();
+ readAndCheckCrc32(0);
pageRecordable = nonTerminalPage;
}
@@ -234,7 +234,7 @@
writeLong(leafPage.getBlockPointer(index));
}
writeLong(leafPage.getNext());
- writeCrc32();
+ writeCrc32(0);
}
private void unmarshallLeafPage() throws HeapException {
@@ -247,7 +247,7 @@
leafPage.setEntry(index, pagePointer, key);
}
leafPage.setNext(readLong());
- readAndCheckCrc32();
+ readAndCheckCrc32(0);
pageRecordable = leafPage;
}
@@ -256,14 +256,14 @@
assert pageRecordable.getByteSize() <= PageConstant.PAGE_SIZE;
final FreePage freePage = (FreePage) pageRecordable;
writeLong(freePage.getNextFreePage());
- writeCrc32();
+ writeCrc32(0);
}
private void unmarshallFreePage() throws HeapException {
final long nextFreePage = readLong();
final FreePage freePage = new FreePage(nextFreePage);
freePage.setPageRecord(this);
- readAndCheckCrc32();
+ readAndCheckCrc32(0);
pageRecordable = freePage;
}
@@ -280,7 +280,7 @@
writeInteger(dataBlock.getSize());
writeBytes(dataBlock.getDataHolder());
}
- writeCrc32();
+ writeCrc32(0);
}
private void unmarshallDataBlock() throws HeapException {
@@ -299,7 +299,7 @@
dataBlock.setSize(readInteger());
readBytes(dataBlock.getDataHolder());
}
- readAndCheckCrc32();
+ readAndCheckCrc32(0);
pageRecordable = dataBlockPage;
}
}
Modified: trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/HeapHeader.java
===================================================================
--- trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/HeapHeader.java 2012-05-04 16:18:55 UTC (rev 3067)
+++ trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/HeapHeader.java 2012-05-04 17:54:02 UTC (rev 3068)
@@ -187,7 +187,7 @@
writeLong(usedSize);
writeLong(freeSize);
writeLong(nextDataRecordIdentifierValue);
- writeCrc32();
+ writeCrc32(0);
}
@Override
@@ -204,7 +204,7 @@
usedSize = readLong();
freeSize = readLong();
nextDataRecordIdentifierValue = readLong();
- readAndCheckCrc32();
+ readAndCheckCrc32(0);
}
/**
Modified: trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/HeapRecord.java
===================================================================
--- trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/HeapRecord.java 2012-05-04 16:18:55 UTC (rev 3067)
+++ trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/HeapRecord.java 2012-05-04 17:54:02 UTC (rev 3068)
@@ -428,13 +428,14 @@
writeInteger(keyData.length);
writeBytes(keyData);
}
- writeCrc32();
+ writeCrc32(0);
if (dataValueChanged) {
- clearCrc32();
+ // clearCrc32();
+ final int offset = numberOfByteReadWrote;
// ASSERTX
assert dataAssociatedSize == dataAssociated.length : DATA_SIZE_MISMATCH;
writeBytes(dataAssociated);
- writeCrc32();
+ writeCrc32(offset);
dataAssociated = null;// NOPMD release data
dataValueChanged = false;
}
@@ -473,7 +474,7 @@
}
// writeInteger(freeNode.getNumberOfChild());
writeInteger(numberOfChild);
- writeCrc32();
+ writeCrc32(0);
}
private void updateFreeNodeData() {
@@ -554,7 +555,7 @@
dataRecordHeaderSize = DATA_RECORD_HEADER_SIZE;
nodeIdentifier = new DataRecordIdentifier(long1);
}
- readAndCheckCrc32();
+ readAndCheckCrc32(0);
}
private void unmarshallFreeRecordHeader() throws HeapException,
@@ -580,7 +581,7 @@
// freeNode.setNumberOfChildUnmarshalling(readInteger());
numberOfChild = readInteger();
// freeNode.valueSetted();
- readAndCheckCrc32();
+ readAndCheckCrc32(0);
}
/**
@@ -752,7 +753,8 @@
}
private void unmarshallDataArea() throws HeapException {
- clearCrc32();
+ // clearCrc32();
+ // final int offset=numberOfByteReadWrote;
final int read = readFileToIoBuffer(dataAssociatedSize + 4);// +4 for
// crc32
// AS-SERT
@@ -761,7 +763,7 @@
+ " but read " + read);
}
dataAssociated = readBytes(dataAssociatedSize);
- readAndCheckCrc32();
+ readAndCheckCrc32(0);
}
/**
Modified: trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/AbstractFileStorable.java
===================================================================
--- trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/AbstractFileStorable.java 2012-05-04 16:18:55 UTC (rev 3067)
+++ trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/AbstractFileStorable.java 2012-05-04 17:54:02 UTC (rev 3068)
@@ -60,11 +60,11 @@
/** to read/write this in file */
protected final IFileForStorable fileForStorable;
- /** to compute crc32 record header */
- private transient int crc32;
+ // /** to compute crc32 record header */
+ // private transient int crc32;
/** current number of byte read or wrote */
- private transient int numberOfByteReadWrote = 0;
+ protected transient int numberOfByteReadWrote = 0;
/** input output buffer */
private transient byte[] ioBuffer;
@@ -108,7 +108,7 @@
// ASSERTX
assert !valueChangedToSave : READING_ERASE_VALUE_CHANGE;
fileForStorable.seek(positionInFile);
- crc32 = 0;
+ // crc32 = 0;
ioBuffer = null;// NOPMD
unmarshallImpl();
ioBuffer = null;// NOPMD
@@ -119,7 +119,7 @@
// ASSERTX
assert valueChangedToSave : NO_VALUE_CHANGE_TO_WRITE;
fileForStorable.seek(positionInFile);
- crc32 = 0;
+ // crc32 = 0;
numberOfByteReadWrote = 0;
ioBuffer = new byte[toMarshallSize()];
marshallImpl();
@@ -179,101 +179,102 @@
valueChangedToSave = false;
}
- /**
- * update crc32 with byte value in buffer
- *
- * @param buffer
- * bytes for crc32 update
- */
- private void updateCrc32(final byte[] buffer) {
- updateCrc32(buffer, 0, buffer.length);
- }
+ // /**
+ // * update crc32 with byte value in buffer
+ // *
+ // * @param buffer
+ // * bytes for crc32 update
+ // */
+ // @SuppressWarnings("unused")
+ // private void _updateCrc32(final byte[] buffer) {
+ // _updateCrc32(buffer, 0, buffer.length);
+ // }
- private void updateCrc32(final byte[] buffer, final int start,
- final int length) {
+ // private void _updateCrc32(final byte[] buffer, final int start,
+ // final int length) {
+ //
+ // int index = start;
+ // for (int count = 0; count < length; count++) {
+ // final byte byteValue = buffer[index++];
+ // updateCrc32(byteValue);
+ // }
+ //
+ // }
- int index = start;
- for (int count = 0; count < length; count++) {
- final byte byteValue = buffer[index++];
- updateCrc32(byteValue);
- }
+ // @SuppressWarnings("unused")
+ // private void _updateCrc32(final byte byteValue) {
+ // int value = byteValue;
+ // for (int j = 0; j < 8; j++) {
+ // final int testbit = ((crc32 >> 31) & 1) ^ (value & 1);
+ // crc32 <<= 2;
+ // if (testbit != 0) {
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // }
+ // value >>= 1;
+ // }
+ // }
- }
+ // private void updateCrc32(final byte byteValue) {
+ // int crc32 = this.crc32;
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x01) == 0x01) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x02) == 0x02) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x04) == 0x04) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x08) == 0x08) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x10) == 0x10) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x20) == 0x20) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x40) == 0x40) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x80) == 0x80) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // this.crc32 = crc32;
+ // }
- @SuppressWarnings("unused")
- private void _updateCrc32(final byte byteValue) {
- int value = byteValue;
- for (int j = 0; j < 8; j++) {
- final int testbit = ((crc32 >> 31) & 1) ^ (value & 1);
- crc32 <<= 2;
- if (testbit != 0) {
- crc32 ^= 0x8005; /* 32 bit crc */
- }
- value >>= 1;
- }
- }
+ // protected void clearCrc32() {
+ // crc32 = 0;
+ // }
- private void updateCrc32(final byte byteValue) {
- int crc32=this.crc32;
- if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x01) == 0x01) {
- crc32 <<= 2;
- crc32 ^= 0x8005; /* 32 bit crc */
- } else {
- crc32 <<= 2;
- }
- if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x02) == 0x02) {
- crc32 <<= 2;
- crc32 ^= 0x8005; /* 32 bit crc */
- } else {
- crc32 <<= 2;
- }
- if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x04) == 0x04) {
- crc32 <<= 2;
- crc32 ^= 0x8005; /* 32 bit crc */
- } else {
- crc32 <<= 2;
- }
- if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x08) == 0x08) {
- crc32 <<= 2;
- crc32 ^= 0x8005; /* 32 bit crc */
- } else {
- crc32 <<= 2;
- }
- if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x10) == 0x10) {
- crc32 <<= 2;
- crc32 ^= 0x8005; /* 32 bit crc */
- } else {
- crc32 <<= 2;
- }
- if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x20) == 0x20) {
- crc32 <<= 2;
- crc32 ^= 0x8005; /* 32 bit crc */
- } else {
- crc32 <<= 2;
- }
- if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x40) == 0x40) {
- crc32 <<= 2;
- crc32 ^= 0x8005; /* 32 bit crc */
- } else {
- crc32 <<= 2;
- }
- if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x80) == 0x80) {
- crc32 <<= 2;
- crc32 ^= 0x8005; /* 32 bit crc */
- } else {
- crc32 <<= 2;
- }
- this.crc32=crc32;
- }
+ // protected int getCrc32() {
+ // return crc32;
+ // }
- protected void clearCrc32() {
- crc32 = 0;
- }
-
- protected int getCrc32() {
- return crc32;
- }
-
protected int readFileToIoBuffer(final int size) throws HeapException {
ioBuffer = new byte[size];
readInIoBuffer = fileForStorable.read(ioBuffer);
@@ -309,19 +310,97 @@
return totalRead;
}
- /**
- * read and check CRC32
- *
- * @throws HeapException
- * read error crc32 error in record
- */
- protected void readAndCheckCrc32() throws HeapException {
- final int computedCrc32 = crc32;
+ // /**
+ // * read and check CRC32
+ // *
+ // * @throws HeapException
+ // * read error crc32 error in record
+ // */
+ // protected void readAndCheckCrc32() throws HeapException {
+ // final int computedCrc32 = crc32;
+ // final int readCrc32 = readInteger();
+ // if (computedCrc32 != readCrc32) {
+ // throw new HeapException(RECORD_INTEGRITY_ERROR
+ // + " record position=" + positionInFile + " read="
+ // + readCrc32 + " computed=" + computedCrc32 + " nb rd/wr="
+ // + numberOfByteReadWrote, EnumFileState.STATE_CORRUPTED);
+ // }
+ // }
+
+ protected void readAndCheckCrc32(final int offset) throws HeapException {
+ int crc32 = 0;
+ for (int index = offset; index < numberOfByteReadWrote; index++) {
+ int byteValue = ioBuffer[index];
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x01) ==
+ // 0x01) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x02) ==
+ // 0x02) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x04) ==
+ // 0x04) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x08) ==
+ // 0x08) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x10) ==
+ // 0x10) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x20) ==
+ // 0x20) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x40) ==
+ // 0x40) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x80) ==
+ // 0x80) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ for (int j = 0; j < 8; j++) {
+ final int testbit = ((crc32 >> 31) & 1) ^ (byteValue & 1);
+ crc32 <<= 2;
+ if (testbit != 0) {
+ crc32 ^= 0x8005; /* 32 bit crc */
+ }
+ byteValue >>= 1;
+ }
+ }
final int readCrc32 = readInteger();
- if (computedCrc32 != readCrc32) {
+ if (crc32 != readCrc32) {
throw new HeapException(RECORD_INTEGRITY_ERROR
+ " record position=" + positionInFile + " read="
- + readCrc32 + " computed=" + computedCrc32 + " nb rd/wr="
+ + readCrc32 + " computed=" + crc32 + " nb rd/wr="
+ numberOfByteReadWrote, EnumFileState.STATE_CORRUPTED);
}
}
@@ -339,7 +418,7 @@
System.arraycopy(ioBuffer, numberOfByteReadWrote, dataByteArray, 0,
length);
numberOfByteReadWrote += length;
- updateCrc32(dataByteArray);
+ // updateCrc32(dataByteArray);
return dataByteArray;
}
@@ -356,7 +435,7 @@
System.arraycopy(ioBuffer, numberOfByteReadWrote, destination, 0,
length);
numberOfByteReadWrote += length;
- updateCrc32(destination);
+ // updateCrc32(destination);
}
/**
@@ -374,7 +453,7 @@
final byte byteValue = ioBuffer[numberOfByteReadWrote + byteIndex];
value = (value << 8) | (((long) byteValue) & 0xff);
}
- updateCrc32(ioBuffer, numberOfByteReadWrote, 8);
+ // updateCrc32(ioBuffer, numberOfByteReadWrote, 8);
numberOfByteReadWrote += 8;
return value;
}
@@ -385,20 +464,20 @@
final byte byteValue = ioBuffer[numberOfByteReadWrote + byteIndex];
value = (value << 8) | (((int) byteValue) & 0xff);
}
- updateCrc32(ioBuffer, numberOfByteReadWrote, 4);
+ // updateCrc32(ioBuffer, numberOfByteReadWrote, 4);
numberOfByteReadWrote += 4;
return value;
}
protected boolean readBoolean() throws HeapException {
final byte byteValue = ioBuffer[numberOfByteReadWrote++];
- updateCrc32(byteValue);
+ // updateCrc32(byteValue);
return byteValue == 0 ? false : true;
}
protected byte readByte() throws HeapException {
final byte byteValue = ioBuffer[numberOfByteReadWrote++];
- updateCrc32(byteValue);
+ // updateCrc32(byteValue);
return byteValue;
}
@@ -413,7 +492,7 @@
System.arraycopy(dataByteArray, 0, ioBuffer, numberOfByteReadWrote,
dataByteArray.length);
numberOfByteReadWrote += dataByteArray.length;
- updateCrc32(dataByteArray);
+ // updateCrc32(dataByteArray);
}
/**
@@ -428,7 +507,7 @@
protected void writeLong(final long value) throws HeapException {
long localValue = value;
for (int byteIndex = 0; byteIndex < 8; byteIndex++) {
- updateCrc32(ioBuffer[numberOfByteReadWrote++] = (byte) localValue);
+ /* updateCrc32( */ioBuffer[numberOfByteReadWrote++] = (byte) localValue/* ) */;
localValue >>= 8;
}
}
@@ -436,25 +515,101 @@
protected void writeInteger(final int value) throws HeapException {
int localValue = value;
for (int byteIndex = 0; byteIndex < 4; byteIndex++) {
- updateCrc32(ioBuffer[numberOfByteReadWrote++] = (byte) localValue);
+ /* updateCrc32( */ioBuffer[numberOfByteReadWrote++] = (byte) localValue/* ) */;
localValue >>= 8;
}
}
- protected void writeCrc32() throws HeapException {
- int localValue = crc32;
+ // protected void writeCrc32() throws HeapException {
+ // int localValue = crc32;
+ // for (int byteIndex = 0; byteIndex < 4; byteIndex++) {
+ // ioBuffer[numberOfByteReadWrote++] = (byte) localValue;
+ // localValue >>= 8;
+ // }
+ // }
+
+ protected void writeCrc32(final int offset) throws HeapException {
+ int crc32 = 0;
+ for (int index = offset; index < numberOfByteReadWrote; index++) {
+ int byteValue = ioBuffer[index];
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x01) ==
+ // 0x01) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x02) ==
+ // 0x02) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x04) ==
+ // 0x04) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x08) ==
+ // 0x08) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x10) ==
+ // 0x10) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x20) ==
+ // 0x20) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x40) ==
+ // 0x40) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ // if ((crc32 & 0x80000000) == 0x80000000 ^ (byteValue & 0x80) ==
+ // 0x80) {
+ // crc32 <<= 2;
+ // crc32 ^= 0x8005; /* 32 bit crc */
+ // } else {
+ // crc32 <<= 2;
+ // }
+ for (int j = 0; j < 8; j++) {
+ final int testbit = ((crc32 >> 31) & 1) ^ (byteValue & 1);
+ crc32 <<= 2;
+ if (testbit != 0) {
+ crc32 ^= 0x8005; /* 32 bit crc */
+ }
+ byteValue >>= 1;
+ }
+ }
for (int byteIndex = 0; byteIndex < 4; byteIndex++) {
- ioBuffer[numberOfByteReadWrote++] = (byte) localValue;
- localValue >>= 8;
+ ioBuffer[numberOfByteReadWrote++] = (byte) crc32;
+ crc32 >>= 8;
}
}
protected void writeBoolean(final boolean value) throws HeapException {
- updateCrc32(ioBuffer[numberOfByteReadWrote++] = (byte) (value ? 1 : 0));
+ /* updateCrc32( */ioBuffer[numberOfByteReadWrote++] = (byte) (value ? 1
+ : 0)/* ) */;
}
protected void writeByte(final byte value) throws HeapException {
- updateCrc32(ioBuffer[numberOfByteReadWrote++] = value);
+ /* updateCrc32( */ioBuffer[numberOfByteReadWrote++] = value/* ) */;
}
@Override
Modified: trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/RecordForTest.java
===================================================================
--- trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/RecordForTest.java 2012-05-04 16:18:55 UTC (rev 3067)
+++ trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/RecordForTest.java 2012-05-04 17:54:02 UTC (rev 3068)
@@ -82,13 +82,13 @@
protected void unmarshallImpl() throws HeapException {
readFileToIoBuffer(8);
value = readInteger();
- readAndCheckCrc32();
+ readAndCheckCrc32(0);
}
@Override
protected void marshallImpl() throws HeapException {
writeInteger(value);
- writeCrc32();
+ writeCrc32(0);
}
@Override
Modified: trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/TestAbstractFileStorable.java
===================================================================
--- trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/TestAbstractFileStorable.java 2012-05-04 16:18:55 UTC (rev 3067)
+++ trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/TestAbstractFileStorable.java 2012-05-04 17:54:02 UTC (rev 3068)
@@ -63,15 +63,17 @@
protected void unmarshallImpl() throws HeapException {
readFileToIoBuffer(dataSize + 4);// +4 for crc32
data = readBytes(dataSize);
- readAndCheckCrc32();
- logger.info("wrote crc32 " + getCrc32() + " pos=" + positionInFile);
+ readAndCheckCrc32(0);
+ // logger.info("wrote crc32 " + getCrc32() + " pos=" +
+ // positionInFile);
}
@Override
protected void marshallImpl() throws HeapException {
writeBytes(data);
- writeCrc32();
- logger.info("wrote crc32 " + getCrc32() + " pos=" + positionInFile);
+ writeCrc32(0);
+ // logger.info("wrote crc32 " + getCrc32() + " pos=" +
+ // positionInFile);
}
@Override
Modified: trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/TestMarshall.java
===================================================================
--- trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/TestMarshall.java 2012-05-04 16:18:55 UTC (rev 3067)
+++ trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/TestMarshall.java 2012-05-04 17:54:02 UTC (rev 3068)
@@ -63,7 +63,7 @@
writeLong(longValue);
writeInteger(intValue);
writeBoolean(booleanValue);
- writeCrc32();
+ writeCrc32(0);
}
@Override
@@ -72,7 +72,7 @@
longValue = readLong();
intValue = readInteger();
booleanValue = readBoolean();
- readAndCheckCrc32();
+ readAndCheckCrc32(0);
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-04 17:54:09
|
Revision: 3068
http://joafip.svn.sourceforge.net/joafip/?rev=3068&view=rev
Author: luc_peuvrier
Date: 2012-05-04 17:54:02 +0000 (Fri, 04 May 2012)
Log Message:
-----------
WIP btree plus: tests OK : WIP check and optimization : write and read/check crc32 change
Modified Paths:
--------------
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/HeaderPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageRecord.java
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/HeapHeader.java
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/HeapRecord.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/AbstractFileStorable.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/RecordForTest.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/TestAbstractFileStorable.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/TestMarshall.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-05 03:18:30
|
Revision: 3070
http://joafip.svn.sourceforge.net/joafip/?rev=3070&view=rev
Author: luc_peuvrier
Date: 2012-05-05 03:18:24 +0000 (Sat, 05 May 2012)
Log Message:
-----------
io buffer optimization
Modified Paths:
--------------
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/mock/MockPageRecord.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCache.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/AbstractFileStorable.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/IFileStorable.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java
Modified: trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/mock/MockPageRecord.java
===================================================================
--- trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/mock/MockPageRecord.java 2012-05-05 01:59:44 UTC (rev 3069)
+++ trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/mock/MockPageRecord.java 2012-05-05 03:18:24 UTC (rev 3070)
@@ -17,7 +17,11 @@
}
@Override
- public byte[] writeToFile() throws HeapException {
+ public void writeToFile() throws HeapException {
+ }
+
+ @Override
+ public byte[] writeToFileGetWrited() throws HeapException {
return null;
}
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCache.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCache.java 2012-05-05 01:59:44 UTC (rev 3069)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCache.java 2012-05-05 03:18:24 UTC (rev 3070)
@@ -245,7 +245,12 @@
@Override
public int readImpl(final byte[] data) throws FileIOException {
- final int length = data.length;
+ return readImpl(data, 0, data.length);
+ }
+
+ @Override
+ protected int readImpl(final byte[] data, final int offset, final int length)
+ throws FileIOException {
int readLength = 0;
byte[] page;
do {
@@ -262,8 +267,8 @@
} else {
copyLength = toRead;
}
- System.arraycopy(page, positionInPage, data, readLength,
- copyLength);
+ System.arraycopy(page, positionInPage, data, readLength
+ + offset, copyLength);
positionInFile += copyLength;
readLength += copyLength;
}
@@ -272,13 +277,6 @@
}
@Override
- protected int readImpl(final byte[] data, final int offset, final int length)
- throws FileIOException {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
public void writeImpl(final byte[] data) throws FileIOException {
writeImpl(data, 0, data.length);
}
Modified: trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/AbstractFileStorable.java
===================================================================
--- trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/AbstractFileStorable.java 2012-05-05 01:59:44 UTC (rev 3069)
+++ trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/AbstractFileStorable.java 2012-05-05 03:18:24 UTC (rev 3070)
@@ -67,7 +67,7 @@
protected transient int numberOfByteReadWrote = 0;
/** input output buffer */
- private transient byte[] ioBuffer;
+ private static transient byte[] ioBuffer = new byte[256];
private transient int readInIoBuffer;
@@ -109,27 +109,38 @@
assert !valueChangedToSave : READING_ERASE_VALUE_CHANGE;
fileForStorable.seek(positionInFile);
// crc32 = 0;
- ioBuffer = null;// NOPMD
+ // ioBuffer = null;// NOPMD
unmarshallImpl();
- ioBuffer = null;// NOPMD
+ // ioBuffer = null;// NOPMD
justCreated = false;
}
- public byte[] writeToFile() throws HeapException {
+ public void writeToFile() throws HeapException {
// ASSERTX
assert valueChangedToSave : NO_VALUE_CHANGE_TO_WRITE;
fileForStorable.seek(positionInFile);
// crc32 = 0;
numberOfByteReadWrote = 0;
- ioBuffer = new byte[toMarshallSize()];
+ readInIoBuffer = toMarshallSize();
+ int length = ioBuffer.length;
+ if (readInIoBuffer > length) {
+ do {
+ length <<= 1;
+ } while (readInIoBuffer > length);
+ ioBuffer = Arrays.copyOf(ioBuffer, length);
+ }
marshallImpl();
- fileForStorable.write(ioBuffer);
+ fileForStorable.write(ioBuffer, 0, readInIoBuffer);
valueChangedToSave = false;
- final byte[] result = ioBuffer;
- ioBuffer = null;// NOPMD discard
- return result;
+ // ioBuffer = null;// NOPMD discard
}
+ @Override
+ public byte[] writeToFileGetWrited() throws HeapException {
+ writeToFile();
+ return Arrays.copyOf(ioBuffer, readInIoBuffer);
+ }
+
/**
*
* @return number of byte to marshal
@@ -276,8 +287,14 @@
// }
protected int readFileToIoBuffer(final int size) throws HeapException {
- ioBuffer = new byte[size];
- readInIoBuffer = fileForStorable.read(ioBuffer);
+ int length = ioBuffer.length;
+ if (size > length) {
+ do {
+ length <<= 1;
+ } while (size > length);
+ ioBuffer = new byte[length];
+ }
+ readInIoBuffer = fileForStorable.read(ioBuffer, 0, size);
// bad test because must read when only maximum size is known
// if( readInIoBuffer!=size) {
// throw new
@@ -297,17 +314,29 @@
*/
protected int readFileAppendToIoBuffer(final int newSize)
throws HeapException {
- final int totalRead;
- if (newSize > ioBuffer.length) {
- ioBuffer = Arrays.copyOf(ioBuffer, newSize);
+ // if (newSize > ioBuffer.length) {
+ // ioBuffer = Arrays.copyOf(ioBuffer, newSize);
+ // final int appendSize = newSize - readInIoBuffer;
+ // final int read = fileForStorable.read(ioBuffer,
+ // readInIoBuffer/* offset */, appendSize/* length */);
+ // totalRead = readInIoBuffer + read;
+ // } else {
+ // totalRead = ioBuffer.length;
+ // }
+ if (newSize > readInIoBuffer) {
+ int length = ioBuffer.length;
+ if (newSize > length) {
+ do {
+ length <<= 1;
+ } while (newSize > length);
+ ioBuffer = Arrays.copyOf(ioBuffer, length);
+ }
final int appendSize = newSize - readInIoBuffer;
final int read = fileForStorable.read(ioBuffer,
readInIoBuffer/* offset */, appendSize/* length */);
- totalRead = readInIoBuffer + read;
- } else {
- totalRead = ioBuffer.length;
+ readInIoBuffer += read;
}
- return totalRead;
+ return readInIoBuffer;
}
// /**
Modified: trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/IFileStorable.java
===================================================================
--- trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/IFileStorable.java 2012-05-05 01:59:44 UTC (rev 3069)
+++ trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/IFileStorable.java 2012-05-05 03:18:24 UTC (rev 3070)
@@ -47,8 +47,10 @@
* @return bytes wrote
* @throws HeapException
*/
- byte[] writeToFile() throws HeapException;
+ void writeToFile() throws HeapException;
+ byte[] writeToFileGetWrited() throws HeapException;
+
/**
* read this file storable from file
*
Modified: trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java
===================================================================
--- trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java 2012-05-05 01:59:44 UTC (rev 3069)
+++ trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java 2012-05-05 03:18:24 UTC (rev 3070)
@@ -920,7 +920,7 @@
if (toBackupList == null) {
header.writeToFile();
} else {
- final byte[] data = header.writeToFile();
+ final byte[] data = header.writeToFileGetWrited();
toBackupList.add(new ToBackupRecord(header
.getPositionInFile(), data));
}
@@ -940,7 +940,7 @@
if (toBackupList == null) {
heapRecord.writeToFile();
} else {
- final byte[] data = heapRecord.writeToFile();
+ final byte[] data = heapRecord.writeToFileGetWrited();
toBackupList.add(new ToBackupRecord(heapRecord.getPositionInFile(),
data));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-05 03:18:30
|
Revision: 3070
http://joafip.svn.sourceforge.net/joafip/?rev=3070&view=rev
Author: luc_peuvrier
Date: 2012-05-05 03:18:24 +0000 (Sat, 05 May 2012)
Log Message:
-----------
io buffer optimization
Modified Paths:
--------------
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/mock/MockPageRecord.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCache.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/AbstractFileStorable.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/IFileStorable.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-06 00:37:34
|
Revision: 3071
http://joafip.svn.sourceforge.net/joafip/?rev=3071&view=rev
Author: luc_peuvrier
Date: 2012-05-06 00:37:25 +0000 (Sun, 06 May 2012)
Log Message:
-----------
IrandomAccessFile implementation added. this implementation use file mapped byte buffer.
IrandomAccessFile implementation must be choose at joafip setup.
Modified Paths:
--------------
trunk/joafip/pom.xml
trunk/joafip/src/main/java/net/sf/joafip/entity/FilePersistenceProperties.java
trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistenceBuilder.java
trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/StoreProperties.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractDelegatingToStoreManagers.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractStoreDelegatingToDataManager.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/ExportStoreQue.java
trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestCustomObjectIO.java
trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestSerializable.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestBobSerializeStackOverflow.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestClear.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestCrashSafe.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestDataManagerCheckerFile.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestDataManagerHeapFile.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestExportImport.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestExportObject.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceNoG.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceOpenClose.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceWithG.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestInnerClassProxy.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestMultiAccessFilePersistence.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestMultipleFilePersistenceInstance.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestSaveFailureDoNotModifyStorage.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestStoreNotStorable.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestVisitedModified.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/AbstractFileCheckPersistenceForTest.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/AbstractFilePersistenceForTest.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestBugChangeLog.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestGarbageModeError.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestRootObjectMapAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestSerializeAndNotLazy1.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestSerializeAndNotLazy2.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/primitive/TestHoldPrimitive.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumKeptInMemory.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumPersistence.java
trunk/joafip/src/test/java/net/sf/joafip/service/joafip_for_test.properties
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestArraySerialization.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestClassLoaderPersistence.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestExclusiveDataAccessSessionUsingProps.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestImport222.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestImport222NotLazy.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestKeptInMemory.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestSubstitutionSerialize.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestSubstitutionSerializeReadWriteMethod.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestSubstitutionSubstitutedSerializable.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestSubstitutionWithDataAccessSession.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestThisInConstructor.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestUseRuntime222.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestUseRuntime222NotLazy.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel301/TestImport300.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel301/TestUseRuntime300Lazy.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel301/TestUseRuntime300NotLazy.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/TestImport301ConversionA.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/TestImport301ConversionB.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/TestUseRuntime301LazyConversionA.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/TestUseRuntime301LazyConversionB.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/TestUseRuntime301NotLazyConversionA.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/TestUseRuntime301NotLazyConversionB.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestEnumMap.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestFileManagementOptions.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestInstanceFactoryUsage.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestPHashMapNewInstance.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestPrivateAccess.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestRuntime310Garbage.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestSaveInExclusiveDataAccessSession.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestStoredImmutableEnum.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestTreeMapIteratorAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestTreeSetIteratorAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestTreeSupportIterator.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestTreeSupportIteratorAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/sync/TestSynchronizedCollection.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractDataManagerTestCase.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/StoreForTest.java
trunk/joafip-4test/src/main/java/net/sf/joafip/bugtree/MainTreeDual.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithCache.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithoutCache.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java
trunk/joafip-4test/src/main/java/net/sf/joafip/service/changelog/CheckSaved.java
trunk/joafip-example-simplestore/src/main/java/net/sf/joafip/simplestore/SimpleStore.java
trunk/joafip-file/pom.xml
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirect.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectNio.java
trunk/joafip-heapfile/pom.xml
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/TestIdNode.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestHeapRecordManage.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestHeapRecordStoreRestore.java
trunk/joafip-kvstore/pom.xml
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/HeapFileSetup.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManagerFactory.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/FileForStorable.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/TestAbstractFileStorable.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/TestMarshall.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/service/AbstractTestHeapElementManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestHeapDataManager.java
trunk/joafip-pmap/src/test/java/net/sf/joafip/pmap/TestFileTreeMap.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/file/FileTests.java
Added Paths:
-----------
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/DiffBuffer.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped2GBLimited.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/AbstractRandomFileTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomAccessFileLogger.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileCacheTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMappedTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectNioTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectTest.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/EnumFileAccessMode.java
Removed Paths:
-------------
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileTest.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-06 00:37:36
|
Revision: 3071
http://joafip.svn.sourceforge.net/joafip/?rev=3071&view=rev
Author: luc_peuvrier
Date: 2012-05-06 00:37:25 +0000 (Sun, 06 May 2012)
Log Message:
-----------
IrandomAccessFile implementation added. this implementation use file mapped byte buffer.
IrandomAccessFile implementation must be choose at joafip setup.
Modified Paths:
--------------
trunk/joafip/pom.xml
trunk/joafip/src/main/java/net/sf/joafip/entity/FilePersistenceProperties.java
trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistenceBuilder.java
trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/StoreProperties.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractDelegatingToStoreManagers.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractStoreDelegatingToDataManager.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/ExportStoreQue.java
trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestCustomObjectIO.java
trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestSerializable.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestBobSerializeStackOverflow.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestClear.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestCrashSafe.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestDataManagerCheckerFile.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestDataManagerHeapFile.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestExportImport.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestExportObject.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceNoG.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceOpenClose.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceWithG.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestInnerClassProxy.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestMultiAccessFilePersistence.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestMultipleFilePersistenceInstance.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestSaveFailureDoNotModifyStorage.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestStoreNotStorable.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestVisitedModified.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/AbstractFileCheckPersistenceForTest.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/AbstractFilePersistenceForTest.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestBugChangeLog.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestGarbageModeError.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestRootObjectMapAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestSerializeAndNotLazy1.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestSerializeAndNotLazy2.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/primitive/TestHoldPrimitive.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumKeptInMemory.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumPersistence.java
trunk/joafip/src/test/java/net/sf/joafip/service/joafip_for_test.properties
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestArraySerialization.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestClassLoaderPersistence.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestExclusiveDataAccessSessionUsingProps.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestImport222.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestImport222NotLazy.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestKeptInMemory.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestSubstitutionSerialize.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestSubstitutionSerializeReadWriteMethod.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestSubstitutionSubstitutedSerializable.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestSubstitutionWithDataAccessSession.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestThisInConstructor.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestUseRuntime222.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestUseRuntime222NotLazy.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel301/TestImport300.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel301/TestUseRuntime300Lazy.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel301/TestUseRuntime300NotLazy.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/TestImport301ConversionA.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/TestImport301ConversionB.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/TestUseRuntime301LazyConversionA.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/TestUseRuntime301LazyConversionB.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/TestUseRuntime301NotLazyConversionA.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/TestUseRuntime301NotLazyConversionB.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestEnumMap.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestFileManagementOptions.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestInstanceFactoryUsage.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestPHashMapNewInstance.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestPrivateAccess.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestRuntime310Garbage.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestSaveInExclusiveDataAccessSession.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestStoredImmutableEnum.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestTreeMapIteratorAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestTreeSetIteratorAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestTreeSupportIterator.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestTreeSupportIteratorAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/sync/TestSynchronizedCollection.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractDataManagerTestCase.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/StoreForTest.java
trunk/joafip-4test/src/main/java/net/sf/joafip/bugtree/MainTreeDual.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithCache.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithoutCache.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java
trunk/joafip-4test/src/main/java/net/sf/joafip/service/changelog/CheckSaved.java
trunk/joafip-example-simplestore/src/main/java/net/sf/joafip/simplestore/SimpleStore.java
trunk/joafip-file/pom.xml
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirect.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectNio.java
trunk/joafip-heapfile/pom.xml
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/TestIdNode.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestHeapRecordManage.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestHeapRecordStoreRestore.java
trunk/joafip-kvstore/pom.xml
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/HeapFileSetup.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManagerFactory.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/FileForStorable.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/TestAbstractFileStorable.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/TestMarshall.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/service/AbstractTestHeapElementManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestHeapDataManager.java
trunk/joafip-pmap/src/test/java/net/sf/joafip/pmap/TestFileTreeMap.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/file/FileTests.java
Added Paths:
-----------
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/DiffBuffer.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped2GBLimited.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/AbstractRandomFileTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomAccessFileLogger.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileCacheTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMappedTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectNioTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectTest.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/EnumFileAccessMode.java
Removed Paths:
-------------
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileTest.java
Modified: trunk/joafip/pom.xml
===================================================================
--- trunk/joafip/pom.xml 2012-05-05 03:18:24 UTC (rev 3070)
+++ trunk/joafip/pom.xml 2012-05-06 00:37:25 UTC (rev 3071)
@@ -33,6 +33,14 @@
<dependency>
<groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-common</artifactId>
+ <version>4.0.0b8</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
<artifactId>joafip-collection</artifactId>
<version>4.0.0b8</version>
</dependency>
@@ -51,18 +59,42 @@
<dependency>
<groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-heapfile</artifactId>
+ <version>4.0.0b8</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
<artifactId>joafip-rbtree</artifactId>
<version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-rbtree</artifactId>
+ <version>4.0.0b8</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
<artifactId>joafip-file</artifactId>
<version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-file</artifactId>
+ <version>4.0.0b8</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
<artifactId>joafip-callback</artifactId>
<version>4.0.0b8</version>
</dependency>
Modified: trunk/joafip/src/main/java/net/sf/joafip/entity/FilePersistenceProperties.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/entity/FilePersistenceProperties.java 2012-05-05 03:18:24 UTC (rev 3070)
+++ trunk/joafip/src/main/java/net/sf/joafip/entity/FilePersistenceProperties.java 2012-05-06 00:37:25 UTC (rev 3071)
@@ -23,8 +23,11 @@
import java.util.TreeSet;
import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.kvstore.entity.EnumFileAccessMode;
import net.sf.joafip.kvstore.service.IHeapDataManager;
+import net.sf.joafip.service.FilePersistenceException;
import net.sf.joafip.store.entity.StoreProperties;
+import net.sf.joafip.store.service.StoreException;
import net.sf.joafip.store.service.conversion.def.InputStreamAndSource;
/**
@@ -138,6 +141,19 @@
return storeProperties;
}
+ public void setFileAccessMode(final EnumFileAccessMode fileAccessMode) {
+ storeProperties.setFileAccessMode(fileAccessMode);
+ }
+
+ public EnumFileAccessMode getFileAccessMode()
+ throws FilePersistenceException {
+ try {
+ return storeProperties.getFileAccessMode();
+ } catch (StoreException exception) {
+ throw new FilePersistenceException(exception);
+ }
+ }
+
public void setPathName(final String pathName) {
storeProperties.setPathName(pathName);
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistenceBuilder.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistenceBuilder.java 2012-05-05 03:18:24 UTC (rev 3070)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistenceBuilder.java 2012-05-06 00:37:25 UTC (rev 3071)
@@ -25,6 +25,7 @@
import net.sf.joafip.NoStorableAccess;
import net.sf.joafip.entity.EnumNoMoreDataAction;
import net.sf.joafip.entity.FilePersistenceProperties;
+import net.sf.joafip.kvstore.entity.EnumFileAccessMode;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.store.service.conversion.def.InputStreamAndSource;
@@ -59,6 +60,10 @@
.setDataModelConversionDefInputStream(dataModelConversionDefInputStream);
}
+ public void setFileAccessMode(final EnumFileAccessMode fileAccessMode) {
+ filePersistenceProperties.setFileAccessMode(fileAccessMode);
+ }
+
/**
*
* @param pathName
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java 2012-05-05 03:18:24 UTC (rev 3070)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java 2012-05-06 00:37:25 UTC (rev 3071)
@@ -36,6 +36,7 @@
import net.sf.joafip.entity.EnumStoreMode;
import net.sf.joafip.entity.FilePersistenceProperties;
import net.sf.joafip.entity.FilePersistencePropertyEntry;
+import net.sf.joafip.kvstore.entity.EnumFileAccessMode;
import net.sf.joafip.store.service.conversion.def.InputStreamAndSource;
/**
@@ -54,6 +55,8 @@
/** conversion definition file construction parameter */
private static final String JOAFIP_DATA_MODEL_CONVERSION_DEF_FILE = "joafip.dataModelConvertionDefFile";
+ private static final String JOAFIP_FILE_ACCESS_MODE = "joafip.fileAccessMode";
+
/** storage directory path construction parameter */
private static final String JOAFIP_PATH = "joafip.path";
@@ -176,7 +179,24 @@
for (Entry<Object, Object> entry : entrySet) {
final String key = (String) entry.getKey();
final String value = (String) entry.getValue();
- if (JOAFIP_PATH.equals(key)) {
+ if (JOAFIP_FILE_ACCESS_MODE.equals(key)) {
+ final EnumFileAccessMode fileAccessMode;
+ if ("random".equals(value)) {
+ fileAccessMode = EnumFileAccessMode.RANDOM_FILE_ACCESS;
+ } else if ("nio".equals(value)) {
+ fileAccessMode = EnumFileAccessMode.NIO_RANDOM_FILE_ACCESS;
+ } else if ("mapped2Gb".equals(value)) {
+ fileAccessMode = EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX;
+ } else if ("mapped".equals(value)) {
+ fileAccessMode = EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS;
+ } else {
+ throw new FilePersistenceException(
+ "bad value \""
+ + value
+ + "\",random, nio, mapped2Gb, or mapped expected");
+ }
+ filePersistenceProperties.setFileAccessMode(fileAccessMode);
+ } else if (JOAFIP_PATH.equals(key)) {
filePersistenceProperties.setPathName(value);
} else if (JOAFIP_DATA_MODEL_IDENTIFIER.equals(key)) {
filePersistenceProperties.setDataModelIdentifier(intValue(
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/StoreProperties.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/StoreProperties.java 2012-05-05 03:18:24 UTC (rev 3070)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/StoreProperties.java 2012-05-06 00:37:25 UTC (rev 3071)
@@ -16,7 +16,9 @@
*/
package net.sf.joafip.store.entity;// NOPMD
+import net.sf.joafip.kvstore.entity.EnumFileAccessMode;
import net.sf.joafip.kvstore.service.IHeapDataManager;
+import net.sf.joafip.store.service.StoreException;
import net.sf.joafip.store.service.conversion.def.InputStreamAndSource;
/**
@@ -73,6 +75,19 @@
private IHeapDataManager dataManager;
+ private EnumFileAccessMode fileAccessMode;
+
+ public void setFileAccessMode(final EnumFileAccessMode fileAccessMode) {
+ this.fileAccessMode = fileAccessMode;
+ }
+
+ public EnumFileAccessMode getFileAccessMode() throws StoreException {
+ if (dataManager == null && fileAccessMode == null) {
+ throw new StoreException("file access mode is not defined");
+ }
+ return fileAccessMode;
+ }
+
public String getPathName() {
return pathName;
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractDelegatingToStoreManagers.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractDelegatingToStoreManagers.java 2012-05-05 03:18:24 UTC (rev 3070)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractDelegatingToStoreManagers.java 2012-05-06 00:37:25 UTC (rev 3071)
@@ -26,6 +26,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.entity.EnumStoreMode;
import net.sf.joafip.entity.MutableInteger;
+import net.sf.joafip.kvstore.entity.EnumFileAccessMode;
import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.reflect.HelperReflect;
@@ -175,7 +176,8 @@
protected AbstractDelegatingToStoreManagers(
final int currentDataModelIdentifier,
final InputStreamAndSource dataModelConversionDefInputStream,
- final IHeapDataManager dataManager, final String pathName,
+ final IHeapDataManager dataManager,
+ final EnumFileAccessMode fileAccessMode, final String pathName,
final String dataFileName, final String backupDataFileName,
final String stateOkFlagFileName,
final String stateBackupOkFlagFileName,
@@ -186,11 +188,12 @@
final int maxFileOperationRetry,
final int fileOperationRetryMsDelay, final boolean garbageManagement)
throws StoreException {
- super(dataManager, pathName, dataFileName, backupDataFileName,
- stateOkFlagFileName, stateBackupOkFlagFileName,
- globalStateFlagFileName, crashSafeMode, useCacheMode, pageSize,
- maxPage, deleteRenaming, clearResizeFile,
- maxFileOperationRetry, fileOperationRetryMsDelay);
+ super(dataManager, fileAccessMode, pathName, dataFileName,
+ backupDataFileName, stateOkFlagFileName,
+ stateBackupOkFlagFileName, globalStateFlagFileName,
+ crashSafeMode, useCacheMode, pageSize, maxPage, deleteRenaming,
+ clearResizeFile, maxFileOperationRetry,
+ fileOperationRetryMsDelay);
this.garbageManagement = garbageManagement;
this.proxyMode = proxyMode;
initialize(currentDataModelIdentifier,
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractStoreDelegatingToDataManager.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractStoreDelegatingToDataManager.java 2012-05-05 03:18:24 UTC (rev 3070)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractStoreDelegatingToDataManager.java 2012-05-06 00:37:25 UTC (rev 3071)
@@ -20,6 +20,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.heapfile.service.HeapFileDataManager;
+import net.sf.joafip.kvstore.entity.EnumFileAccessMode;
import net.sf.joafip.kvstore.entity.HeapFileSetup;
import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
import net.sf.joafip.kvstore.service.HeapException;
@@ -82,7 +83,8 @@
protected IHeapDataManager dataManager;
protected AbstractStoreDelegatingToDataManager(
- final IHeapDataManager dataManager, final String pathName,
+ final IHeapDataManager dataManager,
+ final EnumFileAccessMode fileAccessMode, final String pathName,
final String dataFileName, final String backupDataFileName,
final String stateOkFlagFileName,
final String stateBackupOkFlagFileName,
@@ -98,8 +100,8 @@
: dataFileName;
final File dataFile = new File(pathName, toUseDataFileName);
final File openFileTraceFile = new File(pathName, TRACE_FILE);
- final HeapFileSetup setup = new HeapFileSetup(dataFile,
- crashSafeMode, useCacheMode, deleteRenaming,
+ final HeapFileSetup setup = new HeapFileSetup(fileAccessMode,
+ dataFile, crashSafeMode, useCacheMode, deleteRenaming,
clearResizeFile, maxFileOperationRetry,
fileOperationRetryMsDelay, openFileTraceFile);
if (crashSafeMode) {
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java 2012-05-05 03:18:24 UTC (rev 3070)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java 2012-05-06 00:37:25 UTC (rev 3071)
@@ -178,6 +178,7 @@
/**/storeProperties.getDataModelIdentifier(),
/**/storeProperties.getDataModelConversionDefInputStream(),
/**/storeProperties.getDataManager(),
+ /**/storeProperties.getFileAccessMode(),
/**/storeProperties.getPathName(),
/**/storeProperties.getDataFileName(),
/**/storeProperties.getBackupDataFileName(),
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/ExportStoreQue.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/ExportStoreQue.java 2012-05-05 03:18:24 UTC (rev 3070)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/ExportStoreQue.java 2012-05-06 00:37:25 UTC (rev 3071)
@@ -26,6 +26,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.heapfile.service.AutoSaveHeapFileDataManager;
+import net.sf.joafip.kvstore.entity.EnumFileAccessMode;
import net.sf.joafip.kvstore.entity.HeapFileSetup;
import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
import net.sf.joafip.kvstore.service.HeapException;
@@ -49,13 +50,15 @@
private final byte[] minusOne;
+ // FIXMELUC ___________use of EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS
public ExportStoreQue(final String temporaryDirectoryName)
throws HeapException {
super();
final File dataFile = new File(temporaryDirectoryName + "/set");
- final HeapFileSetup setup = new HeapFileSetup(dataFile,
- false/* crashSafeMode */, true/* useCacheMode */,
+ final HeapFileSetup setup = new HeapFileSetup(
+ EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX,
+ dataFile, false/* crashSafeMode */, true/* useCacheMode */,
false/* deleteRenaming */, false/* clearResizeFile */,
1/* maxFileOperationRetry */, 0/* fileOperationRetryMsDelay */,
null/* openFileTraceFile */);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestCustomObjectIO.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestCustomObjectIO.java 2012-05-05 03:18:24 UTC (rev 3070)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestCustomObjectIO.java 2012-05-06 00:37:25 UTC (rev 3071)
@@ -21,6 +21,7 @@
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
import net.sf.joafip.entity.EnumFilePersistenceCloseAction;
+import net.sf.joafip.kvstore.entity.EnumFileAccessMode;
import net.sf.joafip.store.service.objectfortest.Bob1;
import net.sf.joafip.store.service.objectfortest.Bob2;
import net.sf.joafip.store.service.objectfortest.Bob3;
@@ -49,6 +50,7 @@
// /**/false/* do not remove files */,
// /**/false/* do not manage garbage */);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
builder.setPathName(path.getPath());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestSerializable.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestSerializable.java 2012-05-05 03:18:24 UTC (rev 3070)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestSerializable.java 2012-05-06 00:37:25 UTC (rev 3071)
@@ -26,6 +26,7 @@
import net.sf.joafip.TestException;
import net.sf.joafip.entity.EnumFilePersistenceCloseAction;
import net.sf.joafip.java.util.PTreeMap;
+import net.sf.joafip.kvstore.entity.EnumFileAccessMode;
import net.sf.joafip.store.service.objectfortest.BobSerialize;
import net.sf.joafip.store.service.objectfortest.IBobSerialize;
@@ -61,6 +62,7 @@
// /**/false/* do not remove files */,
// /**/false/* do not manage garbage */);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
builder.setPathName(path.getPath());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestBobSerializeStackOverflow.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestBobSerializeStackOverflow.java 2012-05-05 03:18:24 UTC (rev 3070)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestBobSerializeStackOverflow.java 2012-05-06 00:37:25 UTC (rev 3071)
@@ -30,6 +30,7 @@
import net.sf.joafip.TestException;
import net.sf.joafip.entity.EnumFilePersistenceCloseAction;
import net.sf.joafip.java.util.PLinkedTreeSet;
+import net.sf.joafip.kvstore.entity.EnumFileAccessMode;
import net.sf.joafip.store.service.objectfortest.BobSerialize;
/**
@@ -60,6 +61,7 @@
protected void setUp() throws Exception { // NOPMD
super.setUp();
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
builder.setPathName(path.getPath());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestClear.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestClear.java 2012-05-05 03:18:24 UTC (rev 3070)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestClear.java 2012-05-06 00:37:25 UTC (rev 3071)
@@ -27,6 +27,7 @@
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
import net.sf.joafip.entity.EnumFilePersistenceCloseAction;
+import net.sf.joafip.kvstore.entity.EnumFileAccessMode;
import net.sf.joafip.store.service.objectfortest.Bob1;
/**
@@ -57,6 +58,7 @@
// /**/false/* do not remove files */,
// /**/false/* do not manage garbage */);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
builder.setPathName(path.getPath());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestCrashSafe.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestCrashSafe.java 2012-05-05 03:18:24 UTC (rev 3070)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestCrashSafe.java 2012-05-06 00:37:25 UTC (rev 3071)
@@ -35,6 +35,7 @@
import net.sf.joafip.file.service.FileIOException;
import net.sf.joafip.file.service.IRandomAccessFile;
import net.sf.joafip.file.service.RandomAccessFileDirectNio;
+import net.sf.joafip.kvstore.entity.EnumFileAccessMode;
import net.sf.joafip.kvstore.entity.EnumFileState;
import net.sf.joafip.logger.JoafipLogger;
import net.sf.joafip.store.service.StoreClassNotFoundException;
@@ -170,6 +171,7 @@
// filePersistence = new FilePersistence(1, null,
// TestConstant.getRuntimeDir(), false, false);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
@@ -199,6 +201,7 @@
// filePersistence = new FilePersistence(1, null,
// TestConstant.getRuntimeDir(), false, false);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
@@ -224,6 +227,7 @@
// filePersistence = new FilePersistence(1, null,
// TestConstant.getRuntimeDir(), false, false);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestDataManagerCheckerFile.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestDataManag...
[truncated message content] |
|
From: <luc...@us...> - 2012-05-06 03:16:27
|
Revision: 3072
http://joafip.svn.sourceforge.net/joafip/?rev=3072&view=rev
Author: luc_peuvrier
Date: 2012-05-06 03:16:20 +0000 (Sun, 06 May 2012)
Log Message:
-----------
IrandomAccessFile implementation added. without 2 gigabytes limit implementation use file mapped byte buffer.
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/ExportStoreQue.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithCache.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithoutCache.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java
trunk/joafip-example-simplestore/src/main/java/net/sf/joafip/simplestore/SimpleStore.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped2GBLimited.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMappedTest.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/FileForStorable.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/file/FileTests.java
Added Paths:
-----------
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMapped2GBLimitedTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMappedTest.java.svntmp
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/ExportStoreQue.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/ExportStoreQue.java 2012-05-06 00:37:25 UTC (rev 3071)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/ExportStoreQue.java 2012-05-06 03:16:20 UTC (rev 3072)
@@ -50,15 +50,14 @@
private final byte[] minusOne;
- // FIXMELUC ___________use of EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS
public ExportStoreQue(final String temporaryDirectoryName)
throws HeapException {
super();
final File dataFile = new File(temporaryDirectoryName + "/set");
final HeapFileSetup setup = new HeapFileSetup(
- EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX,
- dataFile, false/* crashSafeMode */, true/* useCacheMode */,
+ EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS, dataFile,
+ false/* crashSafeMode */, true/* useCacheMode */,
false/* deleteRenaming */, false/* clearResizeFile */,
1/* maxFileOperationRetry */, 0/* fileOperationRetryMsDelay */,
null/* openFileTraceFile */);
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java 2012-05-06 00:37:25 UTC (rev 3071)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java 2012-05-06 03:16:20 UTC (rev 3072)
@@ -58,8 +58,8 @@
final String dataFilePath = RUNTIME_DIR + "/block.data";
final File dataFile = new File(dataFilePath);
final HeapFileSetup setup = new HeapFileSetup(
- EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX,
- dataFile, CRASH_SAFE_MODE/* crashSafeMode */,
+ EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS, dataFile,
+ CRASH_SAFE_MODE/* crashSafeMode */,
false/* FILE_CACHE *//* useCacheMode */,
false/* deleteRenaming */, false/* clearResizeFile */,
0/* maxFileOperationRetry */, 0/* fileOperationRetryMsDelay */,
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithCache.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithCache.java 2012-05-06 00:37:25 UTC (rev 3071)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithCache.java 2012-05-06 03:16:20 UTC (rev 3072)
@@ -59,11 +59,11 @@
final File dataFile = new File(dataFilePath);
dataFile.delete();
final HeapFileSetup setup = new HeapFileSetup(
- EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX,
- dataFile, CRASH_SAFE_MODE/* crashSafeMode */,
- true/* useCacheMode */, false/* deleteRenaming */,
- false/* clearResizeFile */, 0/* maxFileOperationRetry */,
- 0/* fileOperationRetryMsDelay */, null/* openFileTraceFile */);
+ EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS, dataFile,
+ CRASH_SAFE_MODE/* crashSafeMode */, true/* useCacheMode */,
+ false/* deleteRenaming */, false/* clearResizeFile */,
+ 0/* maxFileOperationRetry */, 0/* fileOperationRetryMsDelay */,
+ null/* openFileTraceFile */);
setup.cacheSetup(PAGE_SIZE, NUMBER_OF_PAGE);
final IHeapDataManager dataManager =
/**/new BtreePlusDataManager(setup);
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithoutCache.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithoutCache.java 2012-05-06 00:37:25 UTC (rev 3071)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithoutCache.java 2012-05-06 03:16:20 UTC (rev 3072)
@@ -59,8 +59,8 @@
final File dataFile = new File(dataFilePath);
dataFile.delete();
final HeapFileSetup setup = new HeapFileSetup(
- EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX,
- dataFile, CRASH_SAFE_MODE/* crashSafeMode */,
+ EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS, dataFile,
+ CRASH_SAFE_MODE/* crashSafeMode */,
false/* FILE_CACHE *//* useCacheMode */,
false/* deleteRenaming */, false/* clearResizeFile */,
0/* maxFileOperationRetry */, 0/* fileOperationRetryMsDelay */,
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java 2012-05-06 00:37:25 UTC (rev 3071)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java 2012-05-06 03:16:20 UTC (rev 3072)
@@ -51,8 +51,8 @@
final String dataFilePath = RUNTIME_DIR + "/block.data";
final File dataFile = new File(dataFilePath);
final HeapFileSetup setup = new HeapFileSetup(
- EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX,
- dataFile, CRASH_SAFE_MODE/* crashSafeMode */,
+ EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS, dataFile,
+ CRASH_SAFE_MODE/* crashSafeMode */,
false/* FILE_CACHE *//* useCacheMode */,
false/* deleteRenaming */, false/* clearResizeFile */,
0/* maxFileOperationRetry */, 0/* fileOperationRetryMsDelay */,
Modified: trunk/joafip-example-simplestore/src/main/java/net/sf/joafip/simplestore/SimpleStore.java
===================================================================
--- trunk/joafip-example-simplestore/src/main/java/net/sf/joafip/simplestore/SimpleStore.java 2012-05-06 00:37:25 UTC (rev 3071)
+++ trunk/joafip-example-simplestore/src/main/java/net/sf/joafip/simplestore/SimpleStore.java 2012-05-06 03:16:20 UTC (rev 3072)
@@ -74,7 +74,7 @@
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
builder.setDataModelIdentifier(1);
builder.setDataModelConversionDefInputStream(null);
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(storageDirectory.getPath());
builder.setRemoveFiles(false);
builder.setGarbageManagement(false);
Added: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped.java (rev 0)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped.java 2012-05-06 03:16:20 UTC (rev 3072)
@@ -0,0 +1,292 @@
+/*
+ * Copyright 2012 Luc Peuvrier
+ * All rights reserved.
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.file.service;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.MappedByteBuffer;
+import java.nio.channels.FileChannel;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sf.joafip.NotStorableClass;
+import sun.misc.Cleaner;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@SuppressWarnings("restriction")
+@NotStorableClass
+public class RandomAccessFileDirectMapped extends RandomAccessFileDirectNio {
+
+ private static final int MAX_MAP_BITS = 30;
+
+ private static final int MAX_MAP_SIZE = 1 << MAX_MAP_BITS;
+
+ private final List<MappedByteBuffer> mappedByteBufferList = new ArrayList<MappedByteBuffer>();
+
+ private long fileSize;
+
+ public RandomAccessFileDirectMapped(final File file, final int maxRetry,
+ final int retryMsDelay) {
+ super(file, maxRetry, retryMsDelay);
+ }
+
+ @Override
+ public void openImpl() throws FileIOException {
+ super.openImpl();
+ try {
+ fileSize = fileChannel.size();
+ } catch (Exception exception) {
+ throw new FileIOErrorException("opening file", file, exception);
+ }
+ }
+
+ @Override
+ public void closeImpl() throws FileIOException {
+ unMapAll();
+ try {
+ randomAccessFile.setLength(fileSize);
+ } catch (IOException exception) {
+ throw new FileIOErrorException("closing file", file, exception);
+ } finally {
+ super.closeImpl();
+ }
+ }
+
+ @Override
+ public void seekImpl(final long positionInFile) throws FileIOException {
+ currentPositionInFile = positionInFile;
+ }
+
+ @Override
+ public void flushImpl() throws FileIOException {
+ for (MappedByteBuffer mappedByteBuffer : mappedByteBufferList) {
+ mappedByteBuffer.force();
+ }
+ }
+
+ @Override
+ public long lengthImpl() throws FileIOException {
+ return fileSize;
+ }
+
+ @Override
+ public void setLengthImpl(long newSize) throws FileIOException {
+ try {
+ unMapIfMapped(newSize);
+ fileSize = newSize;
+ randomAccessFile.setLength(ceilFileSize(newSize));
+ } catch (IOException exception) {
+ throw HELPER_FILE_UTIL.fileIOException("failed set length of "
+ + file, file, exception);
+ }
+ }
+
+ @Override
+ public int readImpl(final byte[] data) throws FileIOException {
+ return readImpl(data, 0, data.length);
+ }
+
+ @Override
+ protected int readImpl(byte[] data, int offset, int length)
+ throws FileIOException {
+ try {
+ map(currentPositionInFile + length);
+ final int index = (int) (currentPositionInFile >> MAX_MAP_BITS);
+ final long position = ((long) index) << MAX_MAP_BITS;
+ final MappedByteBuffer mappedByteBuffer = mappedByteBufferList
+ .get(index);
+ final int inMapposition = (int) (currentPositionInFile - position);
+ mappedByteBuffer.position(inMapposition);
+ final int positionToEndLength = MAX_MAP_SIZE - inMapposition;
+ ByteBuffer slice = mappedByteBuffer.slice();
+ final int toRead;
+ final int maxLength;
+ if (fileSize > currentPositionInFile) {
+ maxLength = (int) Math.min(fileSize - currentPositionInFile,
+ length);
+ } else {
+ maxLength = 0;
+ }
+ final int read;
+ if (maxLength > positionToEndLength) {
+ slice.get(data, offset, positionToEndLength).limit();
+ slice = mappedByteBufferList.get(index + 1).slice();
+ int xMaxLength = maxLength - positionToEndLength;
+ if (slice.limit() > xMaxLength) {
+ slice.limit(xMaxLength);
+ toRead = xMaxLength;
+ } else {
+ toRead = slice.limit();
+ }
+ read = slice.get(data, offset + positionToEndLength, toRead)
+ .limit() + positionToEndLength;
+ } else {
+ if (slice.limit() > maxLength) {
+ slice.limit(maxLength);
+ toRead = maxLength;
+ } else {
+ toRead = slice.limit();
+ }
+ read = slice.get(data, offset, toRead).limit();
+ }
+ currentPositionInFile += read;
+ return read == 0 ? -1 : read;
+
+ } catch (IOException exception) {
+ throw HELPER_FILE_UTIL.fileIOException("failed read in " + file,
+ file, exception);
+ }
+ }
+
+ @Override
+ public void writeImpl(final byte[] data) throws FileIOException {
+ writeImpl(data, 0, data.length);
+ }
+
+ @Override
+ public void writeImpl(final byte[] data, final int length)
+ throws FileIOException {
+ writeImpl(data, 0, length);
+ }
+
+ @Override
+ protected void writeImpl(final byte[] data, final int offset,
+ final int length) throws FileIOException {
+ try {
+ map(currentPositionInFile + length);
+ final int index = (int) (currentPositionInFile >> MAX_MAP_BITS);
+ final long position = ((long) index) << MAX_MAP_BITS;
+ final MappedByteBuffer mappedByteBuffer = mappedByteBufferList
+ .get(index);
+ final int inMapposition = (int) (currentPositionInFile - position);
+ mappedByteBuffer.position(inMapposition);
+ final int positionToEndLength = MAX_MAP_SIZE - inMapposition;
+ if (length > positionToEndLength) {
+ mappedByteBuffer.put(data, offset, positionToEndLength);
+ mappedByteBufferList.get(index + 1).put(data,
+ offset + positionToEndLength,
+ length - positionToEndLength);
+ } else {
+ mappedByteBuffer.put(data, offset, length);
+ }
+ currentPositionInFile += length;
+ if (currentPositionInFile > fileSize) {
+ fileSize = currentPositionInFile;
+ }
+ } catch (IOException exception) {
+ throw HELPER_FILE_UTIL.fileIOException("failed write in " + file,
+ file, exception);
+ }
+ }
+
+ private void map(final long minimumSize) throws IOException,
+ FileIOErrorException {
+ final long fileSize = fileChannel.size();
+ final long toMapFullSize;
+ if (minimumSize < fileSize) {
+ toMapFullSize = fileSize;
+ } else {
+ toMapFullSize = ceilFileSize(minimumSize);
+ }
+ final int toMapIndex = (int) (toMapFullSize >> MAX_MAP_BITS);
+ int index;
+ for (index = 0; index < toMapIndex; index++) {
+ if (mappedByteBufferList.size() <= index) {
+ final long position = ((long) index) << MAX_MAP_BITS;
+ mappedByteBufferList
+ .add(fileChannel.map(FileChannel.MapMode.READ_WRITE,
+ position, MAX_MAP_SIZE));
+ }
+ }
+ final MappedByteBuffer mappedByteBuffer;
+ if (mappedByteBufferList.size() <= index) {
+ mappedByteBuffer = null;
+ } else {
+ mappedByteBuffer = mappedByteBufferList.get(index);
+ }
+ final long position = ((long) index) << MAX_MAP_BITS;
+ final long mapSize = toMapFullSize - position;
+ if (mappedByteBuffer == null) {
+ // if (logger.isInfoEnabled()) {
+ // logger.info("map " + toMapSize);
+ // }
+ // not mapped then map
+ mappedByteBufferList.add(fileChannel.map(
+ FileChannel.MapMode.READ_WRITE, position, mapSize));
+ } else if (mappedByteBuffer.limit() < mapSize) {
+ // if (logger.isInfoEnabled()) {
+ // logger.info("remap " + toMapSize);
+ // }
+ unMap(mappedByteBuffer);
+ if (fileSize < toMapFullSize) {
+ randomAccessFile.setLength(toMapFullSize);
+ }
+ // not more mapped then map
+ mappedByteBufferList.set(index, fileChannel.map(
+ FileChannel.MapMode.READ_WRITE, position, mapSize));
+ }
+ }
+
+ /**
+ * Returns 16 Megabytes plus the smallest size that is not less than the
+ * argument and is multiple of 16 Megabytes.
+ *
+ * @param realSize
+ * @return
+ */
+ private long ceilFileSize(final long realSize) {
+ // 24 bits for 16 Mbytes
+ return ((realSize >> 24) + 1) << 24;
+ }
+
+ private void unMapIfMapped(final long size) {
+ final int mapIndex = (int) (size >> MAX_MAP_BITS);
+ for (int index = mappedByteBufferList.size() - 1; index >= mapIndex; index--) {
+ final MappedByteBuffer mappedByteBuffer = mappedByteBufferList
+ .remove(index);
+ unMap(mappedByteBuffer);
+ }
+ }
+
+ private void unMapAll() {
+ for (MappedByteBuffer mappedByteBuffer : mappedByteBufferList) {
+ unMap(mappedByteBuffer);
+ }
+ mappedByteBufferList.clear();
+ }
+
+ private void unMap(final MappedByteBuffer mappedByteBuffer) {
+ mappedByteBuffer.force();
+ final Cleaner cleaner = ((sun.nio.ch.DirectBuffer) mappedByteBuffer)
+ .cleaner();
+ if (cleaner != null) {
+ cleaner.clean();
+ }
+ }
+}
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped2GBLimited.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped2GBLimited.java 2012-05-06 00:37:25 UTC (rev 3071)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped2GBLimited.java 2012-05-06 03:16:20 UTC (rev 3072)
@@ -101,7 +101,8 @@
public void setLengthImpl(long newSize) throws FileIOException {
try {
unMapIfMapped();
- randomAccessFile.setLength(newSize);
+ fileSize = newSize;
+ randomAccessFile.setLength(ceilFileSize(newSize));
} catch (IOException exception) {
throw HELPER_FILE_UTIL.fileIOException("failed set length of "
+ file, file, exception);
@@ -118,9 +119,9 @@
throws FileIOException {
try {
check2GigaByte(currentPositionInFile + length);
- map(currentPositionInFile);
+ map(currentPositionInFile + length);
mappedByteBuffer.position((int) currentPositionInFile);
- final ByteBuffer ret = mappedByteBuffer.slice();
+ final ByteBuffer slice = mappedByteBuffer.slice();
final int toRead;
final int maxLength;
if (fileSize > currentPositionInFile) {
@@ -129,16 +130,13 @@
} else {
maxLength = 0;
}
- if (ret.limit() > maxLength) {
- ret.limit(maxLength);
+ if (slice.limit() > maxLength) {
+ slice.limit(maxLength);
toRead = maxLength;
} else {
- toRead = ret.limit();
+ toRead = slice.limit();
}
- // // changes written into buffer will be directly written into file
- // // so we need to protect buffer from modifications
- // ret = ret.asReadOnlyBuffer();
- final int read = ret.get(data, offset, toRead).limit();
+ final int read = slice.get(data, offset, toRead).limit();
currentPositionInFile += read;
return read == 0 ? -1 : read;
@@ -177,14 +175,16 @@
}
}
- private void map(final long minimumSize) throws IOException {
+ private void map(final long minimumSize) throws IOException,
+ FileIOErrorException {
final long fileSize = fileChannel.size();
- final long toMapSize;// = Math.max(minimumSize, fileSize);
+ final long toMapSize;
if (minimumSize < fileSize) {
toMapSize = fileSize;
} else {
- toMapSize = ((minimumSize >> 24) + 1) << 24;// 16 Mbytes
+ toMapSize = ceilFileSize(minimumSize);
}
+ check2GigaByte(toMapSize);
if (mappedByteBuffer == null) {
if (logger.isInfoEnabled()) {
logger.info("map " + toMapSize);
@@ -192,7 +192,7 @@
// not mapped then map
mappedByteBuffer = fileChannel.map(FileChannel.MapMode.READ_WRITE,
0, toMapSize);
- } else if (mappedByteBuffer.capacity() < toMapSize) {
+ } else if (mappedByteBuffer.limit() < toMapSize) {
if (logger.isInfoEnabled()) {
logger.info("remap " + toMapSize);
}
@@ -206,6 +206,18 @@
}
}
+ /**
+ * Returns 16 Megabytes plus the smallest size that is not less than the
+ * argument and is multiple of 16 Megabytes.
+ *
+ * @param realSize
+ * @return
+ */
+ private long ceilFileSize(final long realSize) {
+ // 24 bits for 16 Mbytes
+ return ((realSize >> 24) + 1) << 24;
+ }
+
private void unMapIfMapped() {
if (mappedByteBuffer != null) {
unMap();
Copied: trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMapped2GBLimitedTest.java (from rev 3071, trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMappedTest.java)
===================================================================
--- trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMapped2GBLimitedTest.java (rev 0)
+++ trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMapped2GBLimitedTest.java 2012-05-06 03:16:20 UTC (rev 3072)
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2012 Luc Peuvrier
+ * All rights reserved.
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.file.service;
+
+import java.io.File;
+
+import net.sf.joafip.DoNotTransform;
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.TestException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+@DoNotTransform
+public class RandomFileDirectMapped2GBLimitedTest extends
+ AbstractRandomFileTest {
+
+ public RandomFileDirectMapped2GBLimitedTest() throws TestException {
+ super();
+ }
+
+ public RandomFileDirectMapped2GBLimitedTest(final String name)
+ throws TestException {
+ super(name);
+ }
+
+ @Override
+ protected IRandomAccessFile newRandomAccessFile(final File file,
+ final int maxRetry, final int retryMsDelay) {
+ return new RandomAccessFileDirectMapped2GBLimited(file, maxRetry,
+ retryMsDelay);
+ }
+}
Modified: trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMappedTest.java
===================================================================
--- trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMappedTest.java 2012-05-06 00:37:25 UTC (rev 3071)
+++ trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMappedTest.java 2012-05-06 03:16:20 UTC (rev 3072)
@@ -49,7 +49,6 @@
@Override
protected IRandomAccessFile newRandomAccessFile(final File file,
final int maxRetry, final int retryMsDelay) {
- return new RandomAccessFileDirectMapped2GBLimited(file, maxRetry,
- retryMsDelay);
+ return new RandomAccessFileDirectMapped(file, maxRetry, retryMsDelay);
}
}
Added: trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMappedTest.java.svntmp
===================================================================
--- trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMappedTest.java.svntmp (rev 0)
+++ trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMappedTest.java.svntmp 2012-05-06 03:16:20 UTC (rev 3072)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2012 Luc Peuvrier
+ * All rights reserved.
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.file.service;
+
+import java.io.File;
+
+import net.sf.joafip.DoNotTransform;
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.TestException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+@DoNotTransform
+public class RandomFileDirectMappedTest extends AbstractRandomFileTest {
+
+ public RandomFileDirectMappedTest() throws TestException {
+ super();
+ }
+
+ public RandomFileDirectMappedTest(final String name) throws TestException {
+ super(name);
+ }
+
+ @Override
+ protected IRandomAccessFile newRandomAccessFile(final File file,
+ final int maxRetry, final int retryMsDelay) {
+ return new RandomAccessFileDirectMapped2GBLimited(file, maxRetry,
+ retryMsDelay);
+ }
+}
Modified: trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/FileForStorable.java
===================================================================
--- trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/FileForStorable.java 2012-05-06 00:37:25 UTC (rev 3071)
+++ trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/FileForStorable.java 2012-05-06 03:16:20 UTC (rev 3072)
@@ -22,6 +22,7 @@
import net.sf.joafip.file.service.FileIOException;
import net.sf.joafip.file.service.IRandomAccessFile;
import net.sf.joafip.file.service.RandomAccessFileDirect;
+import net.sf.joafip.file.service.RandomAccessFileDirectMapped;
import net.sf.joafip.file.service.RandomAccessFileDirectMapped2GBLimited;
import net.sf.joafip.file.service.RandomAccessFileDirectNio;
import net.sf.joafip.file.service.RandomAccessFileReadWriteCache;
@@ -211,9 +212,9 @@
file, maxRetry, retryMsDelay);
break;
case MAPPED_RANDOM_FILE_ACCESS:
- // randomAccessFile =
- throw new HeapException("unsupported mode " + fileAccessMode);
- // break;
+ randomAccessFile = new RandomAccessFileDirectMapped(file,
+ maxRetry, retryMsDelay);
+ break;
default:
throw new HeapException("bad file mode " + fileAccessMode);
}
Modified: trunk/joafip-testsuite/src/main/java/net/sf/joafip/file/FileTests.java
===================================================================
--- trunk/joafip-testsuite/src/main/java/net/sf/joafip/file/FileTests.java 2012-05-06 00:37:25 UTC (rev 3071)
+++ trunk/joafip-testsuite/src/main/java/net/sf/joafip/file/FileTests.java 2012-05-06 03:16:20 UTC (rev 3072)
@@ -21,6 +21,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.file.service.RandomAccessFileReadWriteCacheTest;
import net.sf.joafip.file.service.RandomFileCacheTest;
+import net.sf.joafip.file.service.RandomFileDirectMapped2GBLimitedTest;
import net.sf.joafip.file.service.RandomFileDirectMappedTest;
import net.sf.joafip.file.service.RandomFileDirectNioTest;
import net.sf.joafip.file.service.RandomFileDirectTest;
@@ -41,6 +42,7 @@
suite.addTestSuite(RandomFileCacheTest.class);
suite.addTestSuite(RandomAccessFileReadWriteCacheTest.class);
suite.addTestSuite(TestRandomAccessFileCache.class);
+ suite.addTestSuite(RandomFileDirectMapped2GBLimitedTest.class);
suite.addTestSuite(RandomFileDirectMappedTest.class);
// $JUnit-END$
return suite;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-06 03:16:27
|
Revision: 3072
http://joafip.svn.sourceforge.net/joafip/?rev=3072&view=rev
Author: luc_peuvrier
Date: 2012-05-06 03:16:20 +0000 (Sun, 06 May 2012)
Log Message:
-----------
IrandomAccessFile implementation added. without 2 gigabytes limit implementation use file mapped byte buffer.
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/ExportStoreQue.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithCache.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithoutCache.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java
trunk/joafip-example-simplestore/src/main/java/net/sf/joafip/simplestore/SimpleStore.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped2GBLimited.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMappedTest.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/FileForStorable.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/file/FileTests.java
Added Paths:
-----------
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMapped2GBLimitedTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMappedTest.java.svntmp
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-06 09:58:44
|
Revision: 3073
http://joafip.svn.sourceforge.net/joafip/?rev=3073&view=rev
Author: luc_peuvrier
Date: 2012-05-06 09:58:36 +0000 (Sun, 06 May 2012)
Log Message:
-----------
WIP btree plus: tests OK : WIP check and optimization : new tests and corrections
Modified Paths:
--------------
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/HeaderPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IPageRecord.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/LeafPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageRecord.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataManager.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusElementMgr.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/LeafPageTest.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/mock/MockPageRecord.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataManagerBackup.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrMemoryLeak.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrWithKey.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrWithScenario.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataManager.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataManagerBackup.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataManagerFreeing.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrMemoryLeak.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrWithKey.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrWithScenario.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/IHeapRecordFactory.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestHeapDataManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestHeapDataManagerImpl.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/TestBlockDataManager.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusServiceTests.java
Added Paths:
-----------
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageNode.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataManager.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-06 09:58:45
|
Revision: 3073
http://joafip.svn.sourceforge.net/joafip/?rev=3073&view=rev
Author: luc_peuvrier
Date: 2012-05-06 09:58:36 +0000 (Sun, 06 May 2012)
Log Message:
-----------
WIP btree plus: tests OK : WIP check and optimization : new tests and corrections
Modified Paths:
--------------
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/HeaderPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IPageRecord.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/LeafPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageRecord.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataManager.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusElementMgr.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/LeafPageTest.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/mock/MockPageRecord.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataManagerBackup.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrMemoryLeak.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrWithKey.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrWithScenario.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataManager.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataManagerBackup.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataManagerFreeing.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrMemoryLeak.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrWithKey.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapFileDataMgrWithScenario.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/IHeapRecordFactory.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestHeapDataManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestHeapDataManagerImpl.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/TestBlockDataManager.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusServiceTests.java
Added Paths:
-----------
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageNode.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataManager.java
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/HeaderPage.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/HeaderPage.java 2012-05-06 03:16:20 UTC (rev 3072)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/HeaderPage.java 2012-05-06 09:58:36 UTC (rev 3073)
@@ -50,6 +50,8 @@
private long lastRecordPositionInFile;
+ private int numberOfDataRecord;
+
public HeaderPage(final IHeapElementManager heapElementManager) {
super(heapElementManager, 0L);
}
@@ -109,6 +111,7 @@
freeDataBlocks = null;
nextDataRecordIdentifier = 0;
lastRecordPositionInFile = -1L;
+ numberOfDataRecord = 0;
}
@Override
@@ -144,6 +147,7 @@
writeLong(rootPagePosition);
writeLong(nextDataRecordIdentifier);
writeLong(lastRecordPositionInFile);
+ writeInteger(numberOfDataRecord);
initializeFreeDataBlock();
for (int index = 0; index < PageConstant.NUMBER_OF_BLOCK_TYPE; index++) {
writeLong(freeDataBlocks[index]);
@@ -168,6 +172,7 @@
rootPagePosition = readLong();
nextDataRecordIdentifier = readLong();
lastRecordPositionInFile = readLong();
+ numberOfDataRecord = readInteger();
initializeFreeDataBlock();
for (int index = 0; index < PageConstant.NUMBER_OF_BLOCK_TYPE; index++) {
freeDataBlocks[index] = readLong();
@@ -254,4 +259,18 @@
public long getLastRecordPositionInFile() {
return lastRecordPositionInFile;
}
+
+ public void incrementNumberOfDataRecord() throws HeapException {
+ numberOfDataRecord++;
+ setValueIsChangedValueToSave();
+ }
+
+ public void decrementNumberOfDataRecord() throws HeapException {
+ numberOfDataRecord--;
+ setValueIsChangedValueToSave();
+ }
+
+ public int getNumberOfDataRecord() {
+ return numberOfDataRecord;
+ }
}
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IPageRecord.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IPageRecord.java 2012-05-06 03:16:20 UTC (rev 3072)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IPageRecord.java 2012-05-06 09:58:36 UTC (rev 3073)
@@ -61,4 +61,6 @@
long getPageNumber();
+ void setPageRecordable(IPageRecordable pageRecordable) throws HeapException;
+
}
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/LeafPage.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/LeafPage.java 2012-05-06 03:16:20 UTC (rev 3072)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/LeafPage.java 2012-05-06 09:58:36 UTC (rev 3073)
@@ -51,10 +51,8 @@
* value
*/));
- private final long[] dataBlockPosition = new long[MAX_NUMBER_OF_ENTRIES];
+ private final PageNode[] nodes = new PageNode[MAX_NUMBER_OF_ENTRIES];
- private final DataRecordIdentifier[] keys = new DataRecordIdentifier[MAX_NUMBER_OF_ENTRIES];
-
private int numberOfKeyEntries;
private int byteSize;
@@ -110,11 +108,11 @@
}
public DataRecordIdentifier getKey(final int index) {
- return keys[index];
+ return nodes[index].dataRecordIdentifier;
}
public long getBlockPointer(final int index) {
- return dataBlockPosition[index];
+ return nodes[index].pointer;
}
public long getNext() {
@@ -128,8 +126,7 @@
public void setEntry(final int index, final long pagePointer,
final DataRecordIdentifier key) throws HeapException {
- dataBlockPosition[index] = pagePointer;
- keys[index] = key;
+ nodes[index] = new PageNode(key, pagePointer);
byteSize = 0;// unknown size because key size change
setValueIsChangedValueToSave();
}
@@ -154,7 +151,7 @@
} else {
xbyteSize = HEAD_TAIL_SIZE;
for (int index = 0; index < numberOfKeyEntries; index++) {
- xbyteSize += entrySize(keys[index]);
+ xbyteSize += entrySize(nodes[index].dataRecordIdentifier);
}
}
return xbyteSize;
@@ -173,13 +170,17 @@
int end = numberOfKeyEntries - 1;
while (position == -1 && end >= begin) {
final int middle = (begin + end) >> 1;
- final int compareto = dataRecordIdentifier.compareTo(keys[middle]);
+ final int compareto = dataRecordIdentifier
+ .compareTo(nodes[middle].dataRecordIdentifier);
if (compareto < 0) {
end = middle - 1;
} else if (compareto > 0) {
begin = middle + 1;
} else {
- position = dataBlockPosition[middle];
+ position = nodes[middle].pointer;
+ // ASSERTX
+ assert position >= 0;
+ this.index = middle;
}
}
// below was "simpler" implementation
@@ -198,7 +199,7 @@
public void setDataBlock(final int index, final IDataBlock dataBlock)
throws HeapException {
- dataBlockPosition[index] = dataBlock.getPositionInFile();
+ nodes[index].pointer = dataBlock.getPositionInFile();
setValueIsChangedValueToSave();
}
@@ -221,14 +222,11 @@
final int afterLength = numberOfKeyEntries - insertBeforeIndex;
numberOfKeyEntries++;
if (afterLength != 0) {
- System.arraycopy(dataBlockPosition, insertBeforeIndex,
- dataBlockPosition, insertBeforeIndex + 1, afterLength);
- System.arraycopy(keys, insertBeforeIndex, keys,
+ System.arraycopy(nodes, insertBeforeIndex, nodes,
insertBeforeIndex + 1, afterLength);
}
- dataBlockPosition[insertBeforeIndex] = dataBlock
- .getPositionInFile();
- keys[insertBeforeIndex] = dataRecordIdentifier;
+ nodes[insertBeforeIndex] = new PageNode(dataRecordIdentifier,
+ dataBlock.getPositionInFile());
byteSize += entrySize;
// ASSERTX
assert byteSize == computeByteSize() : byteSize + " for "
@@ -247,9 +245,7 @@
final LeafPage newLeafPage = new LeafPage(
newLeafPageNumberOfKeyEntries, longKey);
- System.arraycopy(dataBlockPosition, newNumberOfKeyEntries,
- newLeafPage.dataBlockPosition, 0, newLeafPageNumberOfKeyEntries);
- System.arraycopy(keys, newNumberOfKeyEntries, newLeafPage.keys, 0,
+ System.arraycopy(nodes, newNumberOfKeyEntries, newLeafPage.nodes, 0,
newLeafPageNumberOfKeyEntries);
newLeafPage.updateByteSize();
@@ -271,16 +267,14 @@
}
public void remove(final int index) throws HeapException {
- DataRecordIdentifier dataRecordIdentifier = keys[index];
+ final DataRecordIdentifier dataRecordIdentifier = nodes[index].dataRecordIdentifier;
final int entrySize = entrySize(dataRecordIdentifier);
// ASSERTX
assert byteSize != 0 : "unknow current byte size";
final int afterLength = numberOfKeyEntries - (index + 1);
numberOfKeyEntries--;
if (afterLength != 0) {
- System.arraycopy(dataBlockPosition, index + 1, dataBlockPosition,
- index, afterLength);
- System.arraycopy(keys, index + 1, keys, index, afterLength);
+ System.arraycopy(nodes, index + 1, nodes, index, afterLength);
}
byteSize -= entrySize;
// ASSERTX
@@ -301,7 +295,8 @@
int end = numberOfKeyEntries - 1;
while (end >= begin) {
final int middle = (begin + end) >> 1;
- final int compareto = dataRecordIdentifier.compareTo(keys[middle]);
+ final int compareto = dataRecordIdentifier
+ .compareTo(nodes[middle].dataRecordIdentifier);
if (compareto <= 0) {
end = middle - 1;
} else {
@@ -317,7 +312,7 @@
}
public DataRecordIdentifier getLastKey() {
- return keys[numberOfKeyEntries - 1];
+ return nodes[numberOfKeyEntries - 1].dataRecordIdentifier;
}
/**
@@ -335,9 +330,7 @@
final boolean merged;
if (byteSize + leafPageByteSize - HEAD_TAIL_SIZE <= PageConstant.PAGE_SIZE) {
merged = true;
- System.arraycopy(leafPage.dataBlockPosition, 0, dataBlockPosition,
- numberOfKeyEntries, leafPageNumberOfKeyEntries);
- System.arraycopy(leafPage.keys, 0, keys, numberOfKeyEntries,
+ System.arraycopy(leafPage.nodes, 0, nodes, numberOfKeyEntries,
leafPageNumberOfKeyEntries);
numberOfKeyEntries = totalNumberOfEntries;
// can merge
@@ -352,16 +345,11 @@
- newNumberOfEntries;
if (newNumberOfEntries > numberOfKeyEntries) {
final int length = newNumberOfEntries - numberOfKeyEntries;
- System.arraycopy(leafPage.dataBlockPosition, 0,
- dataBlockPosition, numberOfKeyEntries, length);
- System.arraycopy(leafPage.keys, 0, keys, numberOfKeyEntries,
+ System.arraycopy(leafPage.nodes, 0, nodes, numberOfKeyEntries,
length);
- System.arraycopy(leafPage.dataBlockPosition, length,
- leafPage.dataBlockPosition, 0,
+ System.arraycopy(leafPage.nodes, length, leafPage.nodes, 0,
leafPageNumberOfKeyEntries);
- System.arraycopy(leafPage.keys, length, leafPage.keys, 0,
- leafPageNumberOfKeyEntries);
numberOfKeyEntries = newNumberOfEntries;
leafPage.numberOfKeyEntries = newLeafPageNumberOfEntries;
@@ -371,15 +359,10 @@
final int length = newLeafPageNumberOfEntries
- leafPageNumberOfKeyEntries;
- System.arraycopy(leafPage.dataBlockPosition, 0,
- leafPage.dataBlockPosition, length,
+ System.arraycopy(leafPage.nodes, 0, leafPage.nodes, length,
leafPageNumberOfKeyEntries);
- System.arraycopy(leafPage.keys, 0, leafPage.keys, length,
- leafPageNumberOfKeyEntries);
- System.arraycopy(dataBlockPosition, newNumberOfEntries,
- leafPage.dataBlockPosition, 0, length);
- System.arraycopy(keys, newNumberOfEntries, leafPage.keys, 0,
+ System.arraycopy(nodes, newNumberOfEntries, leafPage.nodes, 0,
length);
numberOfKeyEntries = newNumberOfEntries;
@@ -390,4 +373,8 @@
}
return merged;
}
+
+ public DataRecordIdentifier getFirstKey() {
+ return nodes[0].dataRecordIdentifier;
+ }
}
Added: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageNode.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageNode.java (rev 0)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageNode.java 2012-05-06 09:58:36 UTC (rev 3073)
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2012 Luc Peuvrier
+ * All rights reserved.
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.btreeplus.entity;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class PageNode {
+
+ public DataRecordIdentifier dataRecordIdentifier;
+
+ public long pointer;
+
+ public PageNode(DataRecordIdentifier dataRecordIdentifier, long pointer) {
+ super();
+ this.dataRecordIdentifier = dataRecordIdentifier;
+ this.pointer = pointer;
+ }
+}
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageRecord.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageRecord.java 2012-05-06 03:16:20 UTC (rev 3072)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageRecord.java 2012-05-06 09:58:36 UTC (rev 3073)
@@ -72,6 +72,15 @@
}
@Override
+ public void setPageRecordable(final IPageRecordable pageRecordable)
+ throws HeapException {
+ this.pageRecordable = pageRecordable;
+ this.recordType = pageRecordable.getRecordType();
+ pageRecordable.setPageRecord(this);
+ setValueIsChangedValueToSave();
+ }
+
+ @Override
protected void valueChangedAction() throws HeapException {
/*
* is to be saved
@@ -302,4 +311,23 @@
readAndCheckCrc32(0);
pageRecordable = dataBlockPage;
}
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("PageRecord [recordType=");
+ builder.append(recordType);
+ builder.append(", numberOfPage=");
+ builder.append(getNumberOfPage());
+ builder.append(", pageNumber=");
+ builder.append(pageNumber);
+ builder.append(", previousRecordPositionInFile=");
+ builder.append(previousRecordPositionInFile);
+ builder.append(", longKey=");
+ builder.append(longKey);
+ builder.append(", positionInFile=");
+ builder.append(positionInFile);
+ builder.append("]");
+ return builder.toString();
+ }
}
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataManager.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataManager.java 2012-05-06 03:16:20 UTC (rev 3072)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataManager.java 2012-05-06 09:58:36 UTC (rev 3073)
@@ -167,12 +167,6 @@
btreePlusElementMgr.getNewDataRecordIdentifier());
}
- // ------------------------------------------------------------------------------
- // ------------------------------------------------------------------------------
- // ------------------------------------------------------------------------------
- // ------------------------------------------------------------------------------
- // ------------------------------------------------------------------------------
-
@Override
protected byte[] readDataRecordImpl(
DataRecordIdentifier dataRecordIdentifier) throws HeapException {
@@ -212,6 +206,7 @@
.createDataBlock(data);
btreePlusElementMgr
.newRootLeafPage(dataRecordIdentifier, dataBlock);
+ btreePlusElementMgr.incrementNumberOfDataRecord();
} else {
// existing data
long dataBlockPosition = leafPage
@@ -240,6 +235,7 @@
}
}
}
+ btreePlusElementMgr.incrementNumberOfDataRecord();
} else {
// data record found
created = false;
@@ -312,63 +308,72 @@
leafPage.remove(indexInLeafPage);
final NonTerminalPage nonTerminalPage = (NonTerminalPage) leafPage
.getParentPage();
- final int leafPageInParentIndex = leafPage.getInParentIndex();
- if (leafPage.wellFilled()) {
- if (leafPageInParentIndex != nonTerminalPage
- .getNumberOfKeyEntries()) {
- if (!nonTerminalPage.setKey(leafPageInParentIndex,
- leafPage.getLastKey())) {
- equilibrateFull(nonTerminalPage);
+ if (nonTerminalPage == null) {
+ if (leafPage.getNumberOfKeyEntries() == 0) {
+ btreePlusElementMgr.freePage(leafPage.getPageRecord());
+ btreePlusElementMgr.removeRoot();
+ }
+ } else {
+ final int leafPageInParentIndex = leafPage.getInParentIndex();
+ if (leafPage.wellFilled()) {
+ if (leafPageInParentIndex != nonTerminalPage
+ .getNumberOfKeyEntries()) {
+ if (!nonTerminalPage.setKey(leafPageInParentIndex,
+ leafPage.getLastKey())) {
+ equilibrateFull(nonTerminalPage);
+ }
}
- }
- } else if (leafPageInParentIndex != 0) {
- final int leftLeafPageInParentIndex = leafPageInParentIndex - 1;
- final long leftLeafPagePosition = nonTerminalPage
- .getPagePointer(leftLeafPageInParentIndex);
- final LeafPage leftLeafPage = (LeafPage) btreePlusElementMgr
- .getPage(leftLeafPagePosition, nonTerminalPage,
- leftLeafPageInParentIndex);
- if (leftLeafPage.equilibrate(leafPage)) {
- // leaf page merged in left leaf page
- btreePlusElementMgr.freePage(leafPage.getPageRecord());
- nonTerminalPage.remove(leafPageInParentIndex);
- if (nonTerminalPage.setKey(leftLeafPageInParentIndex,
- leftLeafPage.getLastKey())) {
- equilibrate(nonTerminalPage);
+ } else if (leafPageInParentIndex != 0) {
+ final int leftLeafPageInParentIndex = leafPageInParentIndex - 1;
+ final long leftLeafPagePosition = nonTerminalPage
+ .getPagePointer(leftLeafPageInParentIndex);
+ final LeafPage leftLeafPage = (LeafPage) btreePlusElementMgr
+ .getPage(leftLeafPagePosition, nonTerminalPage,
+ leftLeafPageInParentIndex);
+ if (leftLeafPage.equilibrate(leafPage)) {
+ // leaf page merged in left leaf page
+ btreePlusElementMgr.freePage(leafPage.getPageRecord());
+ nonTerminalPage.remove(leafPageInParentIndex);
+ if (nonTerminalPage.setKey(leftLeafPageInParentIndex,
+ leftLeafPage.getLastKey())) {
+ equilibrate(nonTerminalPage);
+ } else {
+ equilibrateFull(nonTerminalPage);
+ }
} else {
- equilibrateFull(nonTerminalPage);
+ if (!nonTerminalPage.setKey(leftLeafPageInParentIndex,
+ leftLeafPage.getLastKey())) {
+ equilibrateFull(nonTerminalPage);
+ }
}
- } else {
- if (!nonTerminalPage.setKey(leftLeafPageInParentIndex,
- leftLeafPage.getLastKey())) {
- equilibrateFull(nonTerminalPage);
- }
- }
- } else if (leafPageInParentIndex != nonTerminalPage
- .getNumberOfKeyEntries() - 1) {
- final int rightLeafPageinParentIndex = leafPageInParentIndex + 1;
- final long rightLeafPagePosition = nonTerminalPage
- .getPagePointer(rightLeafPageinParentIndex);
- final LeafPage rightLeafPage = (LeafPage) btreePlusElementMgr
- .getPage(rightLeafPagePosition, nonTerminalPage,
- rightLeafPageinParentIndex);
- if (leafPage.equilibrate(rightLeafPage)) {
- // right leaf page merged in leaf page
- btreePlusElementMgr.freePage(rightLeafPage.getPageRecord());
- nonTerminalPage.remove(rightLeafPageinParentIndex);
- if (nonTerminalPage.setKey(leafPageInParentIndex,
- leafPage.getLastKey())) {
- equilibrate(nonTerminalPage);
+ } else if (leafPageInParentIndex != nonTerminalPage
+ .getNumberOfKeyEntries() - 1) {
+ final int rightLeafPageinParentIndex = leafPageInParentIndex + 1;
+ final long rightLeafPagePosition = nonTerminalPage
+ .getPagePointer(rightLeafPageinParentIndex);
+ final LeafPage rightLeafPage = (LeafPage) btreePlusElementMgr
+ .getPage(rightLeafPagePosition, nonTerminalPage,
+ rightLeafPageinParentIndex);
+ if (leafPage.equilibrate(rightLeafPage)) {
+ // right leaf page merged in leaf page
+ btreePlusElementMgr.freePage(rightLeafPage
+ .getPageRecord());
+ nonTerminalPage.remove(rightLeafPageinParentIndex);
+ if (nonTerminalPage.setKey(leafPageInParentIndex,
+ leafPage.getLastKey())) {
+ equilibrate(nonTerminalPage);
+ } else {
+ equilibrateFull(nonTerminalPage);
+ }
} else {
- equilibrateFull(nonTerminalPage);
+ if (!nonTerminalPage.setKey(leafPageInParentIndex,
+ leafPage.getLastKey())) {
+ equilibrateFull(nonTerminalPage);
+ }
}
- } else {
- if (!nonTerminalPage.setKey(leafPageInParentIndex,
- leafPage.getLastKey())) {
- equilibrateFull(nonTerminalPage);
- }
}
}
+ btreePlusElementMgr.decrementNumberOfDataRecord();
}
return deleted;
}
@@ -458,14 +463,29 @@
@Override
protected DataRecordIdentifier removeFirstDataRecordImpl()
throws HeapException {
- // FIXMELUC ________to implement
- throw new HeapException("not implemented");
+ final DataRecordIdentifier first;
+ final IPageRecordable root = btreePlusElementMgr.getRoot();
+ if (root == null) {
+ first = null;
+ } else {
+ IPageRecordable page = root;
+ while (!EnumRecordType.LEAF_PAGE.equals(page.getRecordType())) {
+ final NonTerminalPage nonTerminalPage = (NonTerminalPage) page;
+ final long pagePosition = nonTerminalPage.getPagePointer(0);
+ page = btreePlusElementMgr.getPage(pagePosition, page, 0);
+ }
+ LeafPage leafPage = (LeafPage) page;
+ first = leafPage.getFirstKey();
+ final boolean deleted = deleteDataRecordImpl(first);
+ // ASSRTX
+ assert deleted;
+ }
+ return first;
}
@Override
protected int getNumberOfDataRecordImpl() throws HeapException {
- // FIXMELUC ________to implement
- throw new HeapException("not implemented");
+ return btreePlusElementMgr.getNumberOfDataRecord();
}
@Override
@@ -504,9 +524,13 @@
} else {
final long dataBlockPosition = leafPage
.getDataBlockPosition(dataRecordIdentifier);
- final int indexinLeafPage = leafPage.getIndex();
- dataBlock = btreePlusElementMgr.getDataBlock(dataBlockPosition);
- dataBlock.setParent(leafPage, indexinLeafPage);
+ if (dataBlockPosition == -1L) {
+ dataBlock = null;
+ } else {
+ final int indexinLeafPage = leafPage.getIndex();
+ dataBlock = btreePlusElementMgr.getDataBlock(dataBlockPosition);
+ dataBlock.setParent(leafPage, indexinLeafPage);
+ }
}
return dataBlock;
}
@@ -567,7 +591,7 @@
@Override
public long getRecordPositionInfile(final DataRecordIdentifier identifier)
throws HeapException {
- return btreePlusElementMgr.getRecordPositionInfile(identifier);
+ return dataBlock(identifier).getPositionInFile();
}
@Fortest
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusElementMgr.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusElementMgr.java 2012-05-06 03:16:20 UTC (rev 3072)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusElementMgr.java 2012-05-06 09:58:36 UTC (rev 3073)
@@ -276,7 +276,17 @@
final IDataBlock dataBlock;
if (freeDataBlockPosition == -1L) {
DataBlockPage dataBlockPage = new DataBlockPage(bits);
- internalAppendPageRecordable(dataBlockPage);
+ long pageNumber = header.getFileSizeAsNumberOfPage();
+ long previousRecordPositionInFile = header
+ .getLastRecordPositionInFile();
+ // the new page record for page recordable
+ final IPageRecord pageRecord = new PageRecord(heapElementManager,
+ previousRecordPositionInFile, dataBlockPage, pageNumber);
+ header.setFileSizeAsNumberOfPage(pageNumber
+ + pageRecord.getNumberOfPage());
+ header.setLastRecordPositionInFile(pageNumber << PageConstant.PAGE_BITS);
+ dataBlockPage.setPageRecord(pageRecord);
+ heapElementManager.appendHeapFileRecord(pageRecord);
dataBlockPage.setAllFree();
dataBlock = dataBlockPage.getDataBlocks()[0];
} else {
@@ -289,6 +299,10 @@
return dataBlock;
}
+ public void removeRoot() throws HeapException {
+ header.setRootPagePosition(-1L);
+ }
+
public void remove(final IDataBlock dataBlock) throws HeapException {
final byte bits = dataBlock.getBits();
final long freeDataBlockPosition = header
@@ -302,39 +316,43 @@
throws HeapException {
// ASSERTX
assert notInternalyManagedPage(pageRecordable);
- internalAppendPageRecordable(pageRecordable);
- }
-
- private void internalAppendPageRecordable(
- final IPageRecordable pageRecordable) throws HeapException {
long pageNumber = header.getPageNumberOfFirstFreePage();
- boolean newPage;
final long previousRecordPositionInFile;
+ final PageRecord freePageRecord;
if (pageNumber == -1) {
- newPage = true;
+ freePageRecord = null;
pageNumber = header.getFileSizeAsNumberOfPage();
previousRecordPositionInFile = header.getLastRecordPositionInFile();
} else {
- newPage = false;
- final FreePage freePage = (FreePage) ((PageRecord) heapElementManager
- .readHeapFileDataRecord(pageNumber << PageConstant.PAGE_BITS))
+ freePageRecord = (PageRecord) heapElementManager
+ .readHeapFileDataRecord(pageNumber << PageConstant.PAGE_BITS);
+ // ASSERTX
+ assert freePageRecord.getNumberOfPage() == 1
+ && pageRecordable.getNumberOfPage() == 1;
+ final FreePage freePage = (FreePage) freePageRecord
.getPageRecordable();
header.setPageNumberOfFirstFreePage(freePage.getNextFreePage());
- previousRecordPositionInFile = freePage
- .getPreviousRecordPositionInFile();
+ previousRecordPositionInFile = -1L;// do not care value // freePage
+ // .getPreviousRecordPositionInFile();
}
- final IPageRecord pageRecord = new PageRecord(heapElementManager,
- previousRecordPositionInFile, pageRecordable, pageNumber);
- if (newPage) {
+
+ if (freePageRecord == null) {
+ // the new page record for page recordable
+ final IPageRecord pageRecord = new PageRecord(heapElementManager,
+ previousRecordPositionInFile, pageRecordable, pageNumber);
header.setFileSizeAsNumberOfPage(pageNumber
+ pageRecord.getNumberOfPage());
header.setLastRecordPositionInFile(pageNumber << PageConstant.PAGE_BITS);
+ pageRecordable.setPageRecord(pageRecord);
+ heapElementManager.appendHeapFileRecord(pageRecord);
} else {
- // ASSERTX
- assert pageRecord.getNumberOfPage() == 1;
+ freePageRecord.setPageRecordable(pageRecordable);
}
- pageRecordable.setPageRecord(pageRecord);
- heapElementManager.appendHeapFileRecord(pageRecord);
+ // ASSERTX
+ assert pageRecordable.getNumberOfPage() == 1 : pageRecordable
+ .getNumberOfPage()
+ + " pages for "
+ + pageRecordable.getPageRecord().toString();
}
private boolean notInternalyManagedPage(final IPageRecordable pageRecordable) {
@@ -344,26 +362,27 @@
public void freePage(final IPageRecord pageRecord) throws HeapException {
final long freePageNumber = header.getPageNumberOfFirstFreePage();
- FreePage freePage = new FreePage(freePageNumber);
+ final FreePage freePage = new FreePage(freePageNumber);
+ pageRecord.setPageRecordable(freePage);
+ // freePage.setValueIsChangedValueToSave();
final long newFreePageNumber = pageRecord.getPageNumber();
- final long previousRecordPositionInFile = pageRecord
- .getPreviousRecordPositionInFile();
- PageRecord pageRecord2 = new PageRecord(heapElementManager,
- previousRecordPositionInFile, freePage, newFreePageNumber);
- freePage.setPageRecord(pageRecord2);
- freePage.setValueIsChangedValueToSave();
- heapElementManager.appendHeapFileRecord(pageRecord2);
header.setPageNumberOfFirstFreePage(newFreePageNumber);
}
@Fortest
- public long getRecordPositionInfile(final DataRecordIdentifier identifier) {
- throw new UnsupportedOperationException("not implemented");
+ public long getLastRecordPositionInFile() throws HeapException {
+ return header.getLastRecordPositionInFile();
}
- @Fortest
- public long getLastRecordPositionInFile() throws HeapException {
- return (header.getFileSizeAsNumberOfPage() - 1)
- * PageConstant.PAGE_SIZE;
+ public void incrementNumberOfDataRecord() throws HeapException {
+ header.incrementNumberOfDataRecord();
}
+
+ public void decrementNumberOfDataRecord() throws HeapException {
+ header.decrementNumberOfDataRecord();
+ }
+
+ public int getNumberOfDataRecord() {
+ return header.getNumberOfDataReco...
[truncated message content] |
|
From: <luc...@us...> - 2012-05-07 02:28:19
|
Revision: 3074
http://joafip.svn.sourceforge.net/joafip/?rev=3074&view=rev
Author: luc_peuvrier
Date: 2012-05-07 02:28:12 +0000 (Mon, 07 May 2012)
Log Message:
-----------
WIP btree plus: consistency check added
Modified Paths:
--------------
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractDeleter.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractInserter.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractSearcher.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/ImportSearcher.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBKM.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithCache.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithoutCache.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterFewInsertAndExport.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterHeapFileWithCache.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterHeapFileWithoutCache.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Searcher.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBKM.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java
trunk/joafip-4test/src/main/resources/log4j.properties
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/NonTerminalPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataManager.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusElementMgr.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataManager.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataManagerBackup.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrWithScenario.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestHeapRecordStoreRestore.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/IHeapElementManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/service/mock/MockHeapElementManager.java
trunk/joafip-parent/pom.xml
Added Paths:
-----------
trunk/joafip-4test/src/main/java/net/sf/joafip/btreeplus/
trunk/joafip-4test/src/main/java/net/sf/joafip/heapfile/
trunk/joafip-4test/src/main/java/net/sf/joafip/kvstore/
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusIntigrityCheck.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IntegrityCheckResult.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataMgrIntegrityChecker.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-07 02:28:20
|
Revision: 3074
http://joafip.svn.sourceforge.net/joafip/?rev=3074&view=rev
Author: luc_peuvrier
Date: 2012-05-07 02:28:12 +0000 (Mon, 07 May 2012)
Log Message:
-----------
WIP btree plus: consistency check added
Modified Paths:
--------------
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractDeleter.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractInserter.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractSearcher.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/ImportSearcher.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBKM.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithCache.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithoutCache.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterFewInsertAndExport.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterHeapFileWithCache.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterHeapFileWithoutCache.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Searcher.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBKM.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java
trunk/joafip-4test/src/main/resources/log4j.properties
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/NonTerminalPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataManager.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusElementMgr.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataManager.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataManagerBackup.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrWithScenario.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestHeapRecordStoreRestore.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/IHeapElementManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/service/mock/MockHeapElementManager.java
trunk/joafip-parent/pom.xml
Added Paths:
-----------
trunk/joafip-4test/src/main/java/net/sf/joafip/btreeplus/
trunk/joafip-4test/src/main/java/net/sf/joafip/heapfile/
trunk/joafip-4test/src/main/java/net/sf/joafip/kvstore/
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusIntigrityCheck.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IntegrityCheckResult.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataMgrIntegrityChecker.java
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractDeleter.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractDeleter.java 2012-05-06 09:58:36 UTC (rev 3073)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractDeleter.java 2012-05-07 02:28:12 UTC (rev 3074)
@@ -28,6 +28,7 @@
import java.io.IOException;
import net.sf.joafip.entity.EnumFilePersistenceCloseAction;
+import net.sf.joafip.kvstore.service.HeapException;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.performance.items.entity.Item;
import net.sf.joafip.performance.items.entity.ItemList;
@@ -44,16 +45,17 @@
* @author luc peuvrier
*
*/
-public class AbstractDeleter extends AbstractPerfService {
+public abstract class AbstractDeleter extends AbstractPerfService {
- protected void run(final String pathName,
+ protected void run(final String insertLogFilePath, final String pathName,
final IHeapDataManager dataManager, final Boolean useCache)
throws FilePersistenceException,
FilePersistenceClassNotFoundException,
FilePersistenceInvalidClassException,
FilePersistenceDataCorruptedException,
FilePersistenceNotSerializableException,
- FilePersistenceTooBigForSerializationException, IOException {
+ FilePersistenceTooBigForSerializationException, IOException,
+ HeapException {
initialize(pathName, dataManager, useCache);
final IDataAccessSession session = filePersistence
.createDataAccessSession();
@@ -61,9 +63,11 @@
int batchCount = 0;
int count = 0;
BufferedReader reader = new BufferedReader(new FileReader(
- "runtime_perf/toDelete.txt"));
+ insertLogFilePath));
+ // "runtime_perf/toDelete.txt"));
String line;
while ((line = reader.readLine()) != null) {
+ reader.readLine();// skip one
final int identifier = Integer.parseInt(line);
final ItemList itemList = getItemList(session);
final Item item = itemList.removeItem(identifier);
@@ -75,6 +79,7 @@
count = 0;
session.close(EnumFilePersistenceCloseAction.SAVE);
session.open();
+ consistencyCheck();
++batchCount;
logger.info("delete batch #" + batchCount);
}
@@ -85,8 +90,9 @@
session.open();
batchCount = 0;
count = 0;
- reader = new BufferedReader(new FileReader("runtime_perf/toSearch.txt"));
- while ((line = reader.readLine()) != null) {
+ reader = new BufferedReader(new FileReader(insertLogFilePath));
+ // "runtime_perf/toSearch.txt"));
+ while (reader.readLine() != null && (line = reader.readLine()) != null) {
final int identifier = Integer.parseInt(line);
final ItemList itemList = getItemList(session);
Item item = itemList.get(identifier);
@@ -108,8 +114,10 @@
session.open();
batchCount = 0;
count = 0;
- reader = new BufferedReader(new FileReader("runtime_perf/toDelete.txt"));
+ reader = new BufferedReader(new FileReader(insertLogFilePath));
+ // "runtime_perf/toDelete.txt"));
while ((line = reader.readLine()) != null) {
+ reader.readLine();// skip
final int identifier = Integer.parseInt(line);
final ItemList itemList = getItemList(session);
final Item item = itemList.getItem(identifier);
@@ -128,4 +136,7 @@
reader.close();
session.close(EnumFilePersistenceCloseAction.SAVE);
}
+
+ protected abstract void consistencyCheck() throws HeapException,
+ FilePersistenceException;
}
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractInserter.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractInserter.java 2012-05-06 09:58:36 UTC (rev 3073)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractInserter.java 2012-05-07 02:28:12 UTC (rev 3074)
@@ -43,6 +43,7 @@
import net.sf.joafip.file.entity.PageNode;
import net.sf.joafip.file.service.RandomAccessFileReadWriteCache;
import net.sf.joafip.java.util.PLinkedTreeSet;
+import net.sf.joafip.kvstore.service.HeapException;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.meminspector.service.MemInspectorException;
import net.sf.joafip.meminspector.service.inspect.MemInspector;
@@ -70,7 +71,7 @@
@SuppressWarnings("PMD")
@NotStorableClass
@StorableAccess
-public class AbstractInserter extends AbstractPerfService {
+public abstract class AbstractInserter extends AbstractPerfService {
private static final File FILE_FOR_LUC = new File(RUNTIME_DIR
+ "/forLuc.txt");
@@ -114,7 +115,7 @@
}
}
- protected void run(final String pathName,
+ protected void run(final String insertLogFilePath, final String pathName,
final IHeapDataManager dataManager, final Boolean useCache,
final int numberOfItem) throws FilePersistenceException,
StoreException, FilePersistenceClassNotFoundException,
@@ -123,7 +124,7 @@
FilePersistenceNotSerializableException, MemInspectorException,
IOException, SecurityException, IllegalArgumentException,
NoSuchFieldException, IllegalAccessException,
- FilePersistenceTooBigForSerializationException {
+ FilePersistenceTooBigForSerializationException, HeapException {
initialize(pathName, dataManager, useCache);
final Runtime runtime = Runtime.getRuntime();
final MemInspector memInspectorForMemory = new MemInspector();
@@ -142,6 +143,7 @@
initializeByItemDuration();
boolean objectAddedInMemory = false;
long duration = 0;
+ final PrintWriter insertLogWriter = new PrintWriter(insertLogFilePath);
final InputStream inputStream = getClass().getResourceAsStream(
"/all.txt");
final BufferedReader reader = new BufferedReader(new InputStreamReader(
@@ -169,6 +171,8 @@
final int identifier = Integer.parseInt(reader.readLine());
addItem(session, identifier);
+ insertLogWriter.println(identifier);
+ // consistencyCheck();
if (count % BATCH_SIZE == BATCH_SIZE - 1) {
@@ -229,9 +233,11 @@
byItemIndex++;
session.open();
+ consistencyCheck();
}
}
reader.close();
+ insertLogWriter.close();
session.closeAndWait(EnumFilePersistenceCloseAction.SAVE);
session.open();
@@ -272,6 +278,9 @@
}
}
+ protected abstract void consistencyCheck() throws HeapException,
+ FilePersistenceException;
+
protected void close() throws FilePersistenceException {
filePersistence.close();
}
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java 2012-05-06 09:58:36 UTC (rev 3073)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java 2012-05-07 02:28:12 UTC (rev 3074)
@@ -222,4 +222,8 @@
throw new FilePersistenceException(FAILED_DELETE + dir);
}
}
+
+ protected IHeapDataManager getDataManager() throws FilePersistenceException {
+ return ((FilePersistence) filePersistence).getDataManager();
+ }
}
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractSearcher.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractSearcher.java 2012-05-06 09:58:36 UTC (rev 3073)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractSearcher.java 2012-05-07 02:28:12 UTC (rev 3074)
@@ -22,9 +22,13 @@
*/
package net.sf.joafip.performance.items.service;
+import java.io.BufferedReader;
+import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.io.ObjectOutputStream;
import java.util.LinkedList;
import java.util.List;
@@ -51,7 +55,7 @@
private final JoafipLogger logger = JoafipLogger.getLogger(getClass());
- protected void run(final String pathName,
+ protected void run(final String insertLogFilePath, final String pathName,
final IHeapDataManager dataManager, final Boolean useCache)
throws FilePersistenceException,
FilePersistenceClassNotFoundException,
@@ -71,7 +75,14 @@
final List<Integer> missingList = new LinkedList<Integer>();
int misMatchCount = 0;
final List<String> misMatchList = new LinkedList<String>();
- for (int identifier = 0; identifier < NUMBER_OF_ITEM; identifier++) {
+ final InputStream inputStream = new FileInputStream(insertLogFilePath);
+ final BufferedReader reader = new BufferedReader(new InputStreamReader(
+ inputStream));
+ int count = 0;
+ String line;
+ while ((line = reader.readLine()) != null) {
+ count++;
+ final int identifier = Integer.parseInt(line);
final ItemList itemList = getItemList(session);
final long startSearchTime = System.currentTimeMillis();
final Item item = itemList.get(identifier);
@@ -107,10 +118,11 @@
final long duration = (currentTime - startTime);
final long byItem = duration * 1000 / (identifier + 1);
byItemDuration[byItemIndex++] = (int) byItem;
- logger.info(duration + " mS " + (identifier + 1)
- + " found, by item " + byItem + " uS");
+ logger.info(duration + " mS " + count + " found, by item "
+ + byItem + " uS");
}
}
+ reader.close();
session.close(EnumFilePersistenceCloseAction.DO_NOT_SAVE);
final long endTime = System.currentTimeMillis();
logger.info("min search time " + minSearchTime);
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java 2012-05-06 09:58:36 UTC (rev 3073)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java 2012-05-07 02:28:12 UTC (rev 3074)
@@ -26,7 +26,11 @@
import java.io.File;
import java.io.IOException;
+import net.sf.joafip.btreeplus.entity.IntegrityCheckResult;
import net.sf.joafip.btreeplus.service.BtreePlusDataManager;
+import net.sf.joafip.btreeplus.service.BtreePlusDataMgrIntegrityChecker;
+import net.sf.joafip.file.service.FileIOException;
+import net.sf.joafip.file.service.HelperFileUtil;
import net.sf.joafip.kvstore.entity.EnumFileAccessMode;
import net.sf.joafip.kvstore.entity.HeapFileSetup;
import net.sf.joafip.kvstore.service.HeapException;
@@ -49,14 +53,32 @@
private final static JoafipLogger LOGGER = JoafipLogger
.getLogger(DeleterBtreePlus.class);
+ @Override
+ protected void consistencyCheck() throws HeapException,
+ FilePersistenceException {
+ final IntegrityCheckResult result = BtreePlusDataMgrIntegrityChecker
+ .getInstance().checkIntegrity(getDataManager());
+ System.out.println("depth " + result.getDepth());
+ System.out.println("entriesCount " + result.getEntriesCount());
+ System.out.println("leafPageCount " + result.getLeafPageCount());
+ System.out.println("nonTerminalPageCount "
+ + result.getNonTerminalPageCount());
+ }
+
private void run() throws HeapException, FilePersistenceException,
FilePersistenceClassNotFoundException,
FilePersistenceInvalidClassException,
FilePersistenceDataCorruptedException,
FilePersistenceNotSerializableException,
- FilePersistenceTooBigForSerializationException, IOException {
- final String dataFilePath = RUNTIME_DIR + "/block.data";
+ FilePersistenceTooBigForSerializationException, IOException,
+ FileIOException {
+ final String sourceDataFilePath = RUNTIME_DIR + "/block.data";
+ final String dataFilePath = RUNTIME_DIR + "/block_copy.data";
+ final String insertLogFilePath = RUNTIME_DIR + "/inserted.txt";
+ final File sourceDataFile = new File(sourceDataFilePath);
final File dataFile = new File(dataFilePath);
+ HelperFileUtil.getInstance().copyFile(sourceDataFile, dataFile);
+
final HeapFileSetup setup = new HeapFileSetup(
EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS, dataFile,
CRASH_SAFE_MODE/* crashSafeMode */,
@@ -69,7 +91,7 @@
// }
final IHeapDataManager dataManager =
/**/new BtreePlusDataManager(setup);
- run(null, dataManager, true);
+ run(insertLogFilePath, null, dataManager, true);
}
public static void main(final String[] args) {
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/ImportSearcher.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/ImportSearcher.java 2012-05-06 09:58:36 UTC (rev 3073)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/ImportSearcher.java 2012-05-07 02:28:12 UTC (rev 3074)
@@ -42,7 +42,8 @@
FilePersistenceDataCorruptedException,
FilePersistenceNotSerializableException, IOException,
FilePersistenceTooBigForSerializationException {
- run("runtime_perf/from_import", null, true);
+ final String insertLogFilePath = RUNTIME_DIR + "/inserted.txt";
+ run(insertLogFilePath, "runtime_perf/from_import", null, true);
}
public static void main(final String[] args) {
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBKM.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBKM.java 2012-05-06 09:58:36 UTC (rev 3073)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBKM.java 2012-05-07 02:28:12 UTC (rev 3074)
@@ -50,12 +50,18 @@
IOException, NoSuchFieldException, IllegalAccessException,
FilePersistenceTooBigForSerializationException, HeapException {
final String dataFile = RUNTIME_DIR + "/block.data";
+ final String insertLogFilePath = RUNTIME_DIR + "/inserted.txt";
clearDirectory(RUNTIME_DIR);
final IHeapDataManager dataManager =
/**/new BlockDataManager(dataFile, 1024);
- run(null, dataManager, null, NUMBER_OF_ITEM);
+ run(insertLogFilePath, null, dataManager, null, NUMBER_OF_ITEM);
}
+ @Override
+ protected void consistencyCheck() {
+ // no implementation
+ }
+
public static void main(final String[] args) {
try {
final InserterBKM inserter = new InserterBKM();
Added: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusIntigrityCheck.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusIntigrityCheck.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusIntigrityCheck.java 2012-05-07 02:28:12 UTC (rev 3074)
@@ -0,0 +1,36 @@
+package net.sf.joafip.performance.items.service;
+
+import net.sf.joafip.btreeplus.entity.IntegrityCheckResult;
+import net.sf.joafip.btreeplus.service.BtreePlusDataMgrIntegrityChecker;
+import net.sf.joafip.kvstore.service.HeapException;
+import net.sf.joafip.logger.JoafipLogger;
+import net.sf.joafip.service.FilePersistenceException;
+
+public class InserterBtreePlusIntigrityCheck extends
+ InserterBtreePlusWhithCache {
+
+ private static final JoafipLogger LOGGER = JoafipLogger
+ .getLogger(InserterBtreePlusIntigrityCheck.class);
+
+ @Override
+ protected void consistencyCheck() throws HeapException,
+ FilePersistenceException {
+ final IntegrityCheckResult result = BtreePlusDataMgrIntegrityChecker
+ .getInstance().checkIntegrity(getDataManager());
+ System.out.println("depth " + result.getDepth());
+ System.out.println("entriesCount " + result.getEntriesCount());
+ System.out.println("leafPageCount " + result.getLeafPageCount());
+ System.out.println("nonTerminalPageCount "
+ + result.getNonTerminalPageCount());
+ }
+
+ public static void main(final String[] args) {
+ try {
+ InserterBtreePlusIntigrityCheck inserter = new InserterBtreePlusIntigrityCheck();
+ inserter.run();
+ inserter.close();
+ } catch (final Throwable throwable) {// NOPMD catch all
+ LOGGER.fatal("error", throwable);
+ }
+ }
+}
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithCache.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithCache.java 2012-05-06 09:58:36 UTC (rev 3073)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithCache.java 2012-05-07 02:28:12 UTC (rev 3074)
@@ -36,15 +36,20 @@
import net.sf.joafip.service.FilePersistenceTooBigForSerializationException;
import net.sf.joafip.store.service.StoreException;
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
@SuppressWarnings("PMD")
@NotStorableClass
@StorableAccess
-public final class InserterBtreePlusWhithCache extends AbstractInserter {
+public class InserterBtreePlusWhithCache extends AbstractInserter {
private static final JoafipLogger LOGGER = JoafipLogger
.getLogger(InserterBtreePlusWhithCache.class);
- private void run() throws HeapException, SecurityException,
+ protected void run() throws HeapException, SecurityException,
IllegalArgumentException, FilePersistenceException, StoreException,
FilePersistenceClassNotFoundException,
FilePersistenceInvalidClassException,
@@ -55,6 +60,7 @@
/* remove existing data */
clearDirectory(RUNTIME_DIR);
final String dataFilePath = RUNTIME_DIR + "/block.data";
+ final String insertLogFilePath = RUNTIME_DIR + "/inserted.txt";
/* remove existing data */
final File dataFile = new File(dataFilePath);
dataFile.delete();
@@ -68,9 +74,15 @@
final IHeapDataManager dataManager =
/**/new BtreePlusDataManager(setup);
- run(null, dataManager, true, NUMBER_OF_ITEM);
+ run(insertLogFilePath, null, dataManager, true, NUMBER_OF_ITEM);
}
+ @Override
+ protected void consistencyCheck() throws HeapException,
+ FilePersistenceException {
+ // no implementation
+ }
+
public static void main(final String[] args) {
try {
InserterBtreePlusWhithCache inserter = new InserterBtreePlusWhithCache();
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithoutCache.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithoutCache.java 2012-05-06 09:58:36 UTC (rev 3073)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusWhithoutCache.java 2012-05-07 02:28:12 UTC (rev 3074)
@@ -55,6 +55,7 @@
/* remove existing data */
clearDirectory(RUNTIME_DIR);
final String dataFilePath = RUNTIME_DIR + "/block.data";
+ final String insertLogFilePath = RUNTIME_DIR + "/inserted.txt";
/* remove existing data */
final File dataFile = new File(dataFilePath);
dataFile.delete();
@@ -71,9 +72,14 @@
final IHeapDataManager dataManager =
/**/new BtreePlusDataManager(setup);
- run(null, dataManager, true, NUMBER_OF_ITEM);
+ run(insertLogFilePath, null, dataManager, true, NUMBER_OF_ITEM);
}
+ @Override
+ protected void consistencyCheck() {
+ // no implementation
+ }
+
public static void main(final String[] args) {
try {
InserterBtreePlusWhithoutCache inserter = new InserterBtreePlusWhithoutCache();
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterFewInsertAndExport.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterFewInsertAndExport.java 2012-05-06 09:58:36 UTC (rev 3073)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterFewInsertAndExport.java 2012-05-07 02:28:12 UTC (rev 3074)
@@ -26,6 +26,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
+import net.sf.joafip.kvstore.service.HeapException;
import net.sf.joafip.logger.JoafipLogger;
import net.sf.joafip.meminspector.service.MemInspectorException;
import net.sf.joafip.service.FilePersistenceClassNotFoundException;
@@ -56,11 +57,17 @@
FilePersistenceDataCorruptedException,
FilePersistenceNotSerializableException, MemInspectorException,
IOException, NoSuchFieldException, IllegalAccessException,
- FilePersistenceTooBigForSerializationException {
+ FilePersistenceTooBigForSerializationException, HeapException {
+ final String insertLogFilePath = "runtime/inserted.txt";
clearDirectory("runtime");
- run("runtime", null, true, 1);
+ run(insertLogFilePath, "runtime", null, true, 1);
}
+ @Override
+ protected void consistencyCheck() {
+ // no implementation
+ }
+
public static void main(final String[] args) {
InserterFewInsertAndExport inserter;
try {
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterHeapFileWithCache.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterHeapFileWithCache.java 2012-05-06 09:58:36 UTC (rev 3073)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterHeapFileWithCache.java 2012-05-07 02:28:12 UTC (rev 3074)
@@ -20,6 +20,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
+import net.sf.joafip.kvstore.service.HeapException;
import net.sf.joafip.logger.JoafipLogger;
import net.sf.joafip.meminspector.service.MemInspectorException;
import net.sf.joafip.service.FilePersistenceClassNotFoundException;
@@ -45,12 +46,18 @@
FilePersistenceDataCorruptedException,
FilePersistenceNotSerializableException, MemInspectorException,
IOException, NoSuchFieldException, IllegalAccessException,
- FilePersistenceTooBigForSerializationException {
+ FilePersistenceTooBigForSerializationException, HeapException {
+ final String insertLogFilePath = RUNTIME_DIR + "/inserted.txt";
clearDirectory(RUNTIME_DIR);
- run(RUNTIME_DIR, null, true, NUMBER_OF_ITEM);
+ run(insertLogFilePath, RUNTIME_DIR, null, true, NUMBER_OF_ITEM);
close();
}
+ @Override
+ protected void consistencyCheck() {
+ // no implementation
+ }
+
public static void main(final String[] args) {
try {
InserterHeapFileWithCache inserter = new InserterHeapFileWithCache();
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterHeapFileWithoutCache.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterHeapFileWithoutCache.java 2012-05-06 09:58:36 UTC (rev 3073)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterHeapFileWithoutCache.java 2012-05-07 02:28:12 UTC (rev 3074)
@@ -20,6 +20,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
+import net.sf.joafip.kvstore.service.HeapException;
import net.sf.joafip.logger.JoafipLogger;
import net.sf.joafip.meminspector.service.MemInspectorException;
import net.sf.joafip.service.FilePersistenceClassNotFoundException;
@@ -45,12 +46,18 @@
FilePersistenceDataCorruptedException,
FilePersistenceNotSerializableException, MemInspectorException,
IOException, NoSuchFieldException, IllegalAccessException,
- FilePersistenceTooBigForSerializationException {
+ FilePersistenceTooBigForSerializationException, HeapException {
+ final String insertLogFilePath = RUNTIME_DIR + "/inserted.txt";
clearDirectory(RUNTIME_DIR);
- run(RUNTIME_DIR, null, false, NUMBER_OF_ITEM);
+ run(insertLogFilePath, RUNTIME_DIR, null, false, NUMBER_OF_ITEM);
close();
}
+ @Override
+ protected void consistencyCheck() {
+ // no implementation
+ }
+
public static void main(final String[] args) {
try {
InserterHeapFileWithoutCache inserter = new InserterHeapFileWithoutCache();
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Searcher.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Searcher.java 2012-05-06 09:58:36 UTC (rev 3073)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Searcher.java 2012-05-07 02:28:12 UTC (rev 3074)
@@ -42,7 +42,8 @@
FilePersistenceDataCorruptedException,
FilePersistenceNotSerializableException, IOException,
FilePersistenceTooBigForSerializationException {
- run(RUNTIME_DIR, null, true);
+ final String insertLogFilePath = RUNTIME_DIR + "/inserted.txt";
+ run(insertLogFilePath, RUNTIME_DIR, null, true);
}
public static void main(final String[] args) {
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBKM.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBKM.java 2012-05-06 09:58:36 UTC (rev 3073)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBKM.java 2012-05-07 02:28:12 UTC (rev 3074)
@@ -48,7 +48,8 @@
final String dataFile = RUNTIME_DIR + "/block.data";
final IHeapDataManager dataManager =
/**/new BlockDataManager(dataFile, 1024);
- run(null, dataManager, null);
+ final String insertLogFilePath = RUNTIME_DIR + "/inserted.txt";
+ run(insertLogFilePath, null, dataManager, null);
}
public static void main(final String[] args) {
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java 2012-05-06 09:58:36 UTC (rev 3073)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java 2012-05-07 02:28:12 UTC (rev 3074)
@@ -49,6 +49,7 @@
FilePersistenceNotSerializableException, IOException,
FilePersistenceTooBigForSerializationException {
final String dataFilePath = RUNTIME_DIR + "/block.data";
+ final String insertLogFilePath = RUNTIME_DIR + "/inserted.txt";
final File dataFile = new File(dataFilePath);
final HeapFileSetup setup = new HeapFileSetup(
EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS, dataFile,
@@ -62,7 +63,7 @@
// }
final IHeapDataManager dataManager =
/**/new BtreePlusDataManager(setup);
- run(null, dataManager, null);
+ run(ins...
[truncated message content] |
|
From: <luc...@us...> - 2012-05-08 05:55:42
|
Revision: 3075
http://joafip.svn.sourceforge.net/joafip/?rev=3075&view=rev
Author: luc_peuvrier
Date: 2012-05-08 05:55:35 +0000 (Tue, 08 May 2012)
Log Message:
-----------
WIP btree plus: new tests and corrections, rotation optimization
Modified Paths:
--------------
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractInserter.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusIntigrityCheck.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/AbstractNodePage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/DataBlockPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IPageRecordable.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IntegrityCheckResult.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/LeafPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/NonTerminalPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageNode.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataManager.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataMgrIntegrityChecker.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusElementMgr.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/LeafPageTest.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/NonTerminalPageTest.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataManager.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataManagerBackup.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrWithScenario.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/entity/DataRecordIdentifier.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/entity/DataRecordKey.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusServiceTests.java
Added Paths:
-----------
trunk/joafip-btreeplus/logs/
trunk/joafip-btreeplus/src/main/resources/log4j.properties
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/BigKey.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/BtreePlusLeafPageBalanceMergeTest.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/BtreePlusNonTerminalPageBalanceMergeTest.java
Property Changed:
----------------
trunk/joafip-btreeplus/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-08 05:55:44
|
Revision: 3075
http://joafip.svn.sourceforge.net/joafip/?rev=3075&view=rev
Author: luc_peuvrier
Date: 2012-05-08 05:55:35 +0000 (Tue, 08 May 2012)
Log Message:
-----------
WIP btree plus: new tests and corrections, rotation optimization
Modified Paths:
--------------
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractInserter.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusIntigrityCheck.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/AbstractNodePage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/DataBlockPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IPageRecordable.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IntegrityCheckResult.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/LeafPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/NonTerminalPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageNode.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataManager.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataMgrIntegrityChecker.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusElementMgr.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/LeafPageTest.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/NonTerminalPageTest.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataManager.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataManagerBackup.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/TestBtreePlusDataMgrWithScenario.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/entity/DataRecordIdentifier.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/entity/DataRecordKey.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusServiceTests.java
Added Paths:
-----------
trunk/joafip-btreeplus/logs/
trunk/joafip-btreeplus/src/main/resources/log4j.properties
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/BigKey.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/BtreePlusLeafPageBalanceMergeTest.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/BtreePlusNonTerminalPageBalanceMergeTest.java
Property Changed:
----------------
trunk/joafip-btreeplus/
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractInserter.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractInserter.java 2012-05-07 02:28:12 UTC (rev 3074)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractInserter.java 2012-05-08 05:55:35 UTC (rev 3075)
@@ -171,8 +171,8 @@
final int identifier = Integer.parseInt(reader.readLine());
addItem(session, identifier);
+ // consistencyCheck();
insertLogWriter.println(identifier);
- // consistencyCheck();
if (count % BATCH_SIZE == BATCH_SIZE - 1) {
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java 2012-05-07 02:28:12 UTC (rev 3074)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java 2012-05-08 05:55:35 UTC (rev 3075)
@@ -33,6 +33,7 @@
import net.sf.joafip.file.service.HelperFileUtil;
import net.sf.joafip.kvstore.entity.EnumFileAccessMode;
import net.sf.joafip.kvstore.entity.HeapFileSetup;
+import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
import net.sf.joafip.kvstore.service.HeapException;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.logger.JoafipLogger;
@@ -57,7 +58,9 @@
protected void consistencyCheck() throws HeapException,
FilePersistenceException {
final IntegrityCheckResult result = BtreePlusDataMgrIntegrityChecker
- .getInstance().checkIntegrity(getDataManager());
+ .getInstance().checkIntegrity(getDataManager(),
+ new DataRecordIdentifier(-1),
+ new DataRecordIdentifier(Long.MAX_VALUE));
System.out.println("depth " + result.getDepth());
System.out.println("entriesCount " + result.getEntriesCount());
System.out.println("leafPageCount " + result.getLeafPageCount());
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusIntigrityCheck.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusIntigrityCheck.java 2012-05-07 02:28:12 UTC (rev 3074)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusIntigrityCheck.java 2012-05-08 05:55:35 UTC (rev 3075)
@@ -2,6 +2,7 @@
import net.sf.joafip.btreeplus.entity.IntegrityCheckResult;
import net.sf.joafip.btreeplus.service.BtreePlusDataMgrIntegrityChecker;
+import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
import net.sf.joafip.kvstore.service.HeapException;
import net.sf.joafip.logger.JoafipLogger;
import net.sf.joafip.service.FilePersistenceException;
@@ -16,7 +17,9 @@
protected void consistencyCheck() throws HeapException,
FilePersistenceException {
final IntegrityCheckResult result = BtreePlusDataMgrIntegrityChecker
- .getInstance().checkIntegrity(getDataManager());
+ .getInstance().checkIntegrity(getDataManager(),
+ new DataRecordIdentifier(-1),
+ new DataRecordIdentifier(Long.MAX_VALUE));
System.out.println("depth " + result.getDepth());
System.out.println("entriesCount " + result.getEntriesCount());
System.out.println("leafPageCount " + result.getLeafPageCount());
Property changes on: trunk/joafip-btreeplus
___________________________________________________________________
Modified: svn:ignore
- .settings
.classpath
.project
+ .settings
.classpath
.project
runtime
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/AbstractNodePage.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/AbstractNodePage.java 2012-05-07 02:28:12 UTC (rev 3074)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/AbstractNodePage.java 2012-05-08 05:55:35 UTC (rev 3075)
@@ -41,6 +41,8 @@
this.longKey = longKey;
}
+ public abstract DataRecordIdentifier getLastKey();
+
protected int entrySize(final DataRecordIdentifier key) {
int entryByteSize = 8/* long size for pointer */+ 8/* long size for value */;
if (!longKey) {
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/DataBlockPage.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/DataBlockPage.java 2012-05-07 02:28:12 UTC (rev 3074)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/DataBlockPage.java 2012-05-08 05:55:35 UTC (rev 3075)
@@ -76,7 +76,7 @@
} else {
numberOfPage = n + 1;
}
- // FIXMELUC ________waste space, see below
+ // FIXMELUC ____waste space, see below
// dataBlockDataSize=(numberOfPage<<PageConstant.PAGE_BITS)-
// HEAD_SIZE - 4/* crc32 */
} else {
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IPageRecordable.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IPageRecordable.java 2012-05-07 02:28:12 UTC (rev 3074)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IPageRecordable.java 2012-05-08 05:55:35 UTC (rev 3075)
@@ -47,7 +47,7 @@
*/
int getByteSize();
- void updateByteSize();
+ void updateByteSize() throws HeapException;
IPageRecord getPageRecord() throws HeapException;
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IntegrityCheckResult.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IntegrityCheckResult.java 2012-05-07 02:28:12 UTC (rev 3074)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IntegrityCheckResult.java 2012-05-08 05:55:35 UTC (rev 3075)
@@ -59,4 +59,19 @@
public int getNonTerminalPageCount() {
return nonTerminalPageCount;
}
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("IntegrityCheckResult [depth=");
+ builder.append(depth);
+ builder.append(", entriesCount=");
+ builder.append(entriesCount);
+ builder.append(", leafPageCount=");
+ builder.append(leafPageCount);
+ builder.append(", nonTerminalPageCount=");
+ builder.append(nonTerminalPageCount);
+ builder.append("]");
+ return builder.toString();
+ }
}
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/LeafPage.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/LeafPage.java 2012-05-07 02:28:12 UTC (rev 3074)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/LeafPage.java 2012-05-08 05:55:35 UTC (rev 3075)
@@ -42,7 +42,7 @@
/**/4/* int size for crc32 */+
/**/8/* for next */;
- private static int MAX_NUMBER_OF_ENTRIES =
+ public static int MAX_NUMBER_OF_ENTRIES =
/**/(int) ((PageConstant.PAGE_SIZE - HEAD_TAIL_SIZE) / (8/*
* long size for
* pointer
@@ -65,7 +65,7 @@
private int index;
- public LeafPage(final boolean longKey) {
+ public LeafPage(final boolean longKey) throws HeapException {
this(0, longKey);
updateByteSize();
}
@@ -139,11 +139,11 @@
}
@Override
- public void updateByteSize() {
+ public void updateByteSize() throws HeapException {
byteSize = computeByteSize();
}
- private int computeByteSize() {
+ private int computeByteSize() throws HeapException {
int xbyteSize;
if (longKey) {
// <<4 for *16: 8 (long size for pointer) + 8 (long size for value)
@@ -153,10 +153,29 @@
for (int index = 0; index < numberOfKeyEntries; index++) {
xbyteSize += entrySize(nodes[index].dataRecordIdentifier);
}
+ if (xbyteSize > PageConstant.PAGE_SIZE) {
+ throw new HeapException("too much data " + xbyteSize
+ + " bytes for maximum of " + PageConstant.PAGE_SIZE);
+ }
}
return xbyteSize;
}
+ private int computeByteSize(final int offset, final int length) {
+ int xbyteSize;
+ if (longKey) {
+ // <<4 for *16: 8 (long size for pointer) + 8 (long size for value)
+ xbyteSize = HEAD_TAIL_SIZE + (length << 4);
+ } else {
+ xbyteSize = HEAD_TAIL_SIZE;
+ int index = offset;
+ for (int count = 0; count < length; count++) {
+ xbyteSize += entrySize(nodes[index++].dataRecordIdentifier);
+ }
+ }
+ return xbyteSize;
+ }
+
/**
*
* @param dataRecordIdentifier
@@ -236,6 +255,15 @@
return canAdd;
}
+ /**
+ *
+ * @param dataRecordIdentifier
+ * key to add
+ * @param dataBlock
+ * added data for the key
+ * @return
+ * @throws HeapException
+ */
public LeafPage split(final DataRecordIdentifier dataRecordIdentifier,
final IDataBlock dataBlock) throws HeapException {
final int insertBeforeIndex = computeInsertBeforeIndex(dataRecordIdentifier);
@@ -318,18 +346,19 @@
/**
*
* @param leafPage
- * @return true if merge in this page, leafPage is to be destroyed
+ * @return 0 if merged, 1 if balanced, or 2 if no changes
+ * @throws HeapException
*/
- public boolean equilibrate(final LeafPage leafPage) {
+ public int tryBalanceOrMerge(final LeafPage leafPage) throws HeapException {
// ASSERTX
assert byteSize != 0 : "unknow current byte size";
final int leafPageByteSize = leafPage.getByteSize();
final int leafPageNumberOfKeyEntries = leafPage.numberOfKeyEntries;
final int totalNumberOfEntries = numberOfKeyEntries
+ leafPageNumberOfKeyEntries;
- final boolean merged;
+ final int result;
if (byteSize + leafPageByteSize - HEAD_TAIL_SIZE <= PageConstant.PAGE_SIZE) {
- merged = true;
+ result = 0;// merged
System.arraycopy(leafPage.nodes, 0, nodes, numberOfKeyEntries,
leafPageNumberOfKeyEntries);
numberOfKeyEntries = totalNumberOfEntries;
@@ -339,39 +368,58 @@
assert byteSize == computeByteSize() : byteSize + " for "
+ computeByteSize() + " computed";
} else {
- merged = false;
final int newNumberOfEntries = totalNumberOfEntries / 2;
final int newLeafPageNumberOfEntries = totalNumberOfEntries
- newNumberOfEntries;
if (newNumberOfEntries > numberOfKeyEntries) {
- final int length = newNumberOfEntries - numberOfKeyEntries;
- System.arraycopy(leafPage.nodes, 0, nodes, numberOfKeyEntries,
- length);
-
- System.arraycopy(leafPage.nodes, length, leafPage.nodes, 0,
- leafPageNumberOfKeyEntries);
-
- numberOfKeyEntries = newNumberOfEntries;
- leafPage.numberOfKeyEntries = newLeafPageNumberOfEntries;
- updateByteSize();
- leafPage.updateByteSize();
+ // right to left
+ if (longKey) {
+ result = 1;
+ } else {
+ final int newLeftSize = byteSize
+ + leafPage.computeByteSize(0,
+ leafPageNumberOfKeyEntries
+ - newLeafPageNumberOfEntries);
+ result = newLeftSize > PageConstant.PAGE_SIZE ? 2 : 1;
+ }
+ if (result == 1) {
+ final int length = newNumberOfEntries - numberOfKeyEntries;
+ System.arraycopy(leafPage.nodes, 0, nodes,
+ numberOfKeyEntries, length);
+ System.arraycopy(leafPage.nodes, length, leafPage.nodes, 0,
+ newLeafPageNumberOfEntries);
+ numberOfKeyEntries = newNumberOfEntries;
+ leafPage.numberOfKeyEntries = newLeafPageNumberOfEntries;
+ updateByteSize();
+ leafPage.updateByteSize();
+ }
} else if (newLeafPageNumberOfEntries > leafPageNumberOfKeyEntries) {
- final int length = newLeafPageNumberOfEntries
- - leafPageNumberOfKeyEntries;
-
- System.arraycopy(leafPage.nodes, 0, leafPage.nodes, length,
- leafPageNumberOfKeyEntries);
-
- System.arraycopy(nodes, newNumberOfEntries, leafPage.nodes, 0,
- length);
-
- numberOfKeyEntries = newNumberOfEntries;
- leafPage.numberOfKeyEntries = newLeafPageNumberOfEntries;
- updateByteSize();
- leafPage.updateByteSize();
- }// else no changes
+ // left to right
+ if (longKey) {
+ result = 1;
+ } else {
+ final int newRightSize = leafPageByteSize
+ + computeByteSize(newNumberOfEntries,
+ numberOfKeyEntries - newNumberOfEntries);
+ result = newRightSize > PageConstant.PAGE_SIZE ? 2 : 1;
+ }
+ if (result == 1) {
+ final int length = newLeafPageNumberOfEntries
+ - leafPageNumberOfKeyEntries;
+ System.arraycopy(leafPage.nodes, 0, leafPage.nodes, length,
+ leafPageNumberOfKeyEntries);
+ System.arraycopy(nodes, newNumberOfEntries, leafPage.nodes,
+ 0, length);
+ numberOfKeyEntries = newNumberOfEntries;
+ leafPage.numberOfKeyEntries = newLeafPageNumberOfEntries;
+ updateByteSize();
+ leafPage.updateByteSize();
+ }
+ } else {
+ result = 2; // no changes
+ }
}
- return merged;
+ return result;
}
public DataRecordIdentifier getFirstKey() {
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/NonTerminalPage.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/NonTerminalPage.java 2012-05-07 02:28:12 UTC (rev 3074)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/NonTerminalPage.java 2012-05-08 05:55:35 UTC (rev 3075)
@@ -44,7 +44,7 @@
/**/4/* int size for crc32 */+
/**/8/* last pointer long size */;
- private static int MAX_NUMBER_OF_ENTRIES =
+ public static int MAX_NUMBER_OF_ENTRIES =
/**/(int) ((PageConstant.PAGE_SIZE - HEAD_TAIL_SIZE) / (8/*
* long size for
* pointer
@@ -69,11 +69,18 @@
private DataRecordIdentifier middleKey;
- public NonTerminalPage(final boolean longKey) {
+ @Fortest
+ public NonTerminalPage(final boolean longKey) throws HeapException {
this(0, longKey);
updateByteSize();
}
+ /**
+ * not static set creation
+ *
+ * @param numberOfKeyEntries
+ * @param longKey
+ */
public NonTerminalPage(final int numberOfKeyEntries, final boolean longKey) {
super(longKey);
this.numberOfKeyEntries = numberOfKeyEntries;
@@ -83,7 +90,7 @@
@Fortest
public NonTerminalPage(final int numberOfKeyEntries,
final DataRecordIdentifier[] keys, final long[] pagePosition,
- final boolean longKey) {
+ final boolean longKey) throws HeapException {
super(longKey);
assert numberOfKeyEntries == keys.length
&& numberOfKeyEntries + 1 == pagePosition.length;
@@ -92,6 +99,8 @@
System.arraycopy(pagePosition, 0, this.pagePositions, 0,
numberOfKeyEntries + 1);
updateByteSize();
+ // ASSERTX
+ assert checkKeys();
}
@Override
@@ -128,6 +137,9 @@
keys[index] = key;
}
setValueIsChangedValueToSave();
+ // no because us for state setting
+ // //ASSERTX
+ // assert checkKeys();
}
/**
@@ -140,13 +152,23 @@
*/
public boolean setKey(final int index, final DataRecordIdentifier key)
throws HeapException {
- DataRecordIdentifier oldKey = keys[index];
- keys[index] = key;
- byteSize = byteSize - entrySize(oldKey) + entrySize(key);
- // ASSERTX
- assert byteSize == computeByteSize();
- setValueIsChangedValueToSave();
- return byteSize < PageConstant.PAGE_SIZE;
+ if (longKey) {
+ keys[index] = key;
+ // ASSERTX
+ assert checkKeys();
+ setValueIsChangedValueToSave();
+ return true;
+ } else {
+ DataRecordIdentifier oldKey = keys[index];
+ keys[index] = key;
+ // ASSERTX
+ assert checkKeys();
+ byteSize = byteSize - entrySize(oldKey) + entrySize(key);
+ // ASSERTX
+ assert byteSize == computeByteSize();
+ setValueIsChangedValueToSave();
+ return byteSize < PageConstant.PAGE_SIZE;
+ }
}
@Override
@@ -157,11 +179,16 @@
}
@Override
- public void updateByteSize() {
+ public void updateByteSize() throws HeapException {
byteSize = computeByteSize();
}
- private int computeByteSize() {
+ @Fortest
+ public void updateByteSizeAcceptBigger() throws HeapException {
+ byteSize = computeByteSizeAcceptBigger();
+ }
+
+ private int computeByteSize() throws HeapException {
int xbyteSize;
if (longKey) {
// <<4 for *16: 8 (long size for pointer) + 8 (long size for value)
@@ -172,9 +199,51 @@
xbyteSize += entrySize(keys[index]);
}
}
+ if (xbyteSize > PageConstant.PAGE_SIZE) {
+ throw new HeapException("too much data " + xbyteSize
+ + " bytes for maximum of " + PageConstant.PAGE_SIZE);
+ }
return xbyteSize;
}
+ private int computeByteSizeAcceptBigger() {
+ int xbyteSize;
+ if (longKey) {
+ // <<4 for *16: 8 (long size for pointer) + 8 (long size for value)
+ xbyteSize = HEAD_TAIL_SIZE + (numberOfKeyEntries << 4);
+ } else {
+ xbyteSize = HEAD_TAIL_SIZE;
+ for (int index = 0; index < numberOfKeyEntries; index++) {
+ xbyteSize += entrySize(keys[index]);
+ }
+ }
+ return xbyteSize;
+ }
+
+ private int computeByteSize(final int offset, final int length)
+ throws HeapException {
+ int xbyteSize;
+ if (longKey) {
+ // <<4 for *16: 8 (long size for pointer) + 8 (long size for value)
+ xbyteSize = HEAD_TAIL_SIZE + (length << 4);
+ } else {
+ xbyteSize = HEAD_TAIL_SIZE;
+ int index = offset;
+ for (int count = 0; count < length; count++) {
+ xbyteSize += entrySize(keys[index++]);
+ }
+ }
+ return xbyteSize;
+ }
+
+ private int computeByteSizeForAssert() {
+ try {
+ return computeByteSize();
+ } catch (HeapException exception) {
+ throw new AssertionError(exception);
+ }
+ }
+
@Override
public int getNumberOfKeyEntries() {
return numberOfKeyEntries;
@@ -241,10 +310,12 @@
keys[index] = key;
pagePositions[index + 1] = newRightILeafPage.getPositionInFile();
// ASSERTX
+ assert checkKeys();
+ // ASSERTX
assert byteSize != 0 : "unknow current byte size";
byteSize += entrySize;
// ASSERTX
- assert byteSize == computeByteSize();
+ assert byteSize == computeByteSizeAcceptBigger();
setValueIsChangedValueToSave();
return byteSize < PageConstant.PAGE_SIZE;
}
@@ -274,10 +345,12 @@
pagePositions[index + 1] = rightSonNonTerminalPage.getPositionInFile();
// ASSERTX
+ assert checkKeys();
+ // ASSERTX
assert byteSize != 0 : "unknow current byte size";
byteSize += entrySize;
// ASSERTX
- assert byteSize == computeByteSize();
+ assert byteSize == computeByteSizeAcceptBigger();
setValueIsChangedValueToSave();
return byteSize < PageConstant.PAGE_SIZE;
}
@@ -296,6 +369,10 @@
System.arraycopy(pagePositions, splitIndex + 1,
nonTerminalPage.pagePositions, 0, newNumberOfKeyEntries + 1);
+ // ASSERTX
+ assert checkKeys();
+ assert nonTerminalPage.checkKeys();
+
nonTerminalPage.updateByteSize();
numberOfKeyEntries = newNumberOfKeyEntries;
updateByteSize();
@@ -325,11 +402,13 @@
System.arraycopy(pagePositions, leafPageInParentIndex + 1,
pagePositions, leafPageInParentIndex, length + 1);
// ASSERTX
+ assert checkKeys();
+ // ASSERTX
assert byteSize != 0 : "unknow current byte size";
byteSize -= entrySize(key);
// ASSERTX
- assert byteSize == computeByteSize() : "byteSize=" + byteSize
- + ", computed=" + computeByteSize();
+ assert byteSize == computeByteSizeForAssert() : "byteSize=" + byteSize
+ + ", computed=" + computeByteSizeForAssert();
}
public boolean wellFilled() {
@@ -343,20 +422,21 @@
*
* @param middleKey
* @param rightNonTerminalPage
- * @return true if merge in this page, nonTerminalPage is to be destroyed
+ * @return 0 if merged, 1 if balanced, or 2 if no changes
+ * @throws HeapException
*/
- public boolean equilibrate(final DataRecordIdentifier middleKey,
- final NonTerminalPage rightNonTerminalPage) {
+ public int tryBalanceOrMerge(final DataRecordIdentifier middleKey,
+ final NonTerminalPage rightNonTerminalPage) throws HeapException {
assert byteSize != 0 : "unknow current byte size";
final int rightPageByteSize = rightNonTerminalPage.getByteSize();
final int middleKeySize = entrySize(middleKey);
final int rightPageNumberOfKeyEntries = rightNonTerminalPage.numberOfKeyEntries;
final int totalNumberOfEntries = numberOfKeyEntries
+ rightPageNumberOfKeyEntries;
- final boolean merged;
+ final int result;
if (byteSize + middleKeySize + rightPageByteSize - HEAD_TAIL_SIZE <= PageConstant.PAGE_SIZE) {
// can merge
- merged = true;
+ result = 0;
System.arraycopy(rightNonTerminalPage.pagePositions, 0,
pagePositions, numberOfKeyEntries + 1,
rightPageNumberOfKeyEntries + 1);
@@ -366,59 +446,94 @@
numberOfKeyEntries = totalNumberOfEntries + 1;
byteSize += middleKeySize + rightPageByteSize - HEAD_TAIL_SIZE;
// ASSERTX
+ assert checkKeys();
+ // ASSERTX
assert byteSize == computeByteSize() : "byteSize=" + byteSize
+ ", computed=" + computeByteSize();
} else {
- merged = false;
final int newNumberOfEntries = totalNumberOfEntries / 2;
final int newRightPageNumberOfEntries = totalNumberOfEntries
- newNumberOfEntries;
if (newNumberOfEntries > numberOfKeyEntries) {
- int length = newNumberOfEntries - numberOfKeyEntries;
- System.arraycopy(rightNonTerminalPage.pagePositions, 0,
- pagePositions, numberOfKeyEntries + 1, length);
- keys[numberOfKeyEntries] = middleKey;
- System.arraycopy(rightNonTerminalPage.keys, 0, keys,
- numberOfKeyEntries + 1, length - 1);
- this.middleKey = rightNonTerminalPage.keys[length - 1];
- numberOfKeyEntries = newNumberOfEntries;
- updateByteSize();
- length = rightPageNumberOfKeyEntries
- - newRightPageNumberOfEntries;
- System.arraycopy(rightNonTerminalPage.pagePositions, length,
- rightNonTerminalPage.pagePositions, 0,
- rightPageNumberOfKeyEntries + 1);
- System.arraycopy(rightNonTerminalPage.keys, length,
- rightNonTerminalPage.keys, 0,
- rightPageNumberOfKeyEntries);
- rightNonTerminalPage.numberOfKeyEntries = newRightPageNumberOfEntries;
- rightNonTerminalPage.updateByteSize();
+ // right to left
+ if (longKey) {
+ result = 1;
+ } else {
+ final int newLeftSize = byteSize
+ + middleKeySize
+ + rightNonTerminalPage.computeByteSize(0,
+ rightPageNumberOfKeyEntries
+ - newRightPageNumberOfEntries);
+ result = newLeftSize > PageConstant.PAGE_SIZE ? 2 : 1;
+ }
+ if (result == 1) {
+ int length = newNumberOfEntries - numberOfKeyEntries;
+ System.arraycopy(rightNonTerminalPage.pagePositions, 0,
+ pagePositions, numberOfKeyEntries + 1, length);
+ keys[numberOfKeyEntries] = middleKey;
+ System.arraycopy(rightNonTerminalPage.keys, 0, keys,
+ numberOfKeyEntries + 1, length - 1);
+ this.middleKey = rightNonTerminalPage.keys[length - 1];
+ numberOfKeyEntries = newNumberOfEntries;
+ // ASSERTX
+ assert checkKeys();
+ updateByteSize();
+ length = rightPageNumberOfKeyEntries
+ - newRightPageNumberOfEntries;
+ System.arraycopy(rightNonTerminalPage.pagePositions,
+ length, rightNonTerminalPage.pagePositions, 0,
+ newRightPageNumberOfEntries + 1);
+ System.arraycopy(rightNonTerminalPage.keys, length,
+ rightNonTerminalPage.keys, 0,
+ newRightPageNumberOfEntries);
+ rightNonTerminalPage.numberOfKeyEntries = newRightPageNumberOfEntries;
+ rightNonTerminalPage.updateByteSize();
+ // ASSERTX
+ assert rightNonTerminalPage.checkKeys();
+ }
} else if (newRightPageNumberOfEntries > rightPageNumberOfKeyEntries) {
- final int length = newRightPageNumberOfEntries
- - rightPageNumberOfKeyEntries;
- this.middleKey = keys[newNumberOfEntries];
+ // left to right
+ if (longKey) {
+ result = 1;
+ } else {
+ final int newRightSize = rightPageByteSize
+ + middleKeySize
+ + computeByteSize(newNumberOfEntries,
+ numberOfKeyEntries - newNumberOfEntries);
+ result = newRightSize > PageConstant.PAGE_SIZE ? 2 : 1;
+ }
+ if (result == 1) {
+ final int length = newRightPageNumberOfEntries
+ - rightPageNumberOfKeyEntries;
+ this.middleKey = keys[newNumberOfEntries];
- System.arraycopy(rightNonTerminalPage.pagePositions, 0,
- rightNonTerminalPage.pagePositions, length,
- rightPageNumberOfKeyEntries + 1);
- System.arraycopy(rightNonTerminalPage.keys, 0,
- rightNonTerminalPage.keys, length,
- rightPageNumberOfKeyEntries);
+ System.arraycopy(rightNonTerminalPage.pagePositions, 0,
+ rightNonTerminalPage.pagePositions, length,
+ rightPageNumberOfKeyEntries + 1);
+ System.arraycopy(rightNonTerminalPage.keys, 0,
+ rightNonTerminalPage.keys, length,
+ rightPageNumberOfKeyEntries);
- System.arraycopy(pagePositions, newNumberOfEntries + 1,
- rightNonTerminalPage.pagePositions, 0, length);
- System.arraycopy(keys, newNumberOfEntries + 1,
- rightNonTerminalPage.keys, 0, length - 1);
+ System.arraycopy(pagePositions, newNumberOfEntries + 1,
+ rightNonTerminalPage.pagePositions, 0, length);
+ System.arraycopy(keys, newNumberOfEntries + 1,
+ rightNonTerminalPage.keys, 0, length - 1);
- rightNonTerminalPage.keys[length - 1] = middleKey;
+ rightNonTerminalPage.keys[length - 1] = middleKey;
- rightNonTerminalPage.numberOfKeyEntries = newRightPageNumberOfEntries;
- rightNonTerminalPage.updateByteSize();
- numberOfKeyEntries = newNumberOfEntries;
- updateByteSize();
+ rightNonTerminalPage.numberOfKeyEntries = newRightPageNumberOfEntries;
+ rightNonTerminalPage.updateByteSize();
+ numberOfKeyEntries = newNumberOfEntries;
+ updateByteSize();
+ // ASSERTX
+ assert checkKeys();
+ assert rightNonTerminalPage.checkKeys();
+ }
+ } else {
+ result = 2;
}
}
- return merged;
+ return result;
}
public DataRecordIdentifier getLastKey() {
@@ -432,4 +547,20 @@
public DataRecordIdentifier getFirstKey() {
return keys[0];
}
+
+ /**
+ * for assertion
+ *
+ * @return true if keys ok
+ */
+ public boolean checkKeys() {
+ DataRecordIdentifier currentKey = keys[0];
+ boolean ok = true;
+ for (int index = 1; ok && index < numberOfKeyEntries; index++) {
+ final DataRecordIdentifier nextKey = keys[index];
+ ok = currentKey.compareTo(nextKey) < 0;
+ currentKey = nextKey;
+ }
+ return ok;
+ }
}
Modified: trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageNode.java
===================================================================
--- trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageNode.java 2012-05-07 02:28:12 UTC (rev 3074)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageNode.java 2012-05-08 05:55:35 UTC (rev 3075)
@@ -43,4 +43,15 @@
this.dataRecordIdentifier = dataRecordIdentifier;
this.pointer = pointer;
}
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("PageNode [dataRecordIdentifier=");
+ builder.append(dataRecordIdentifier);
+ builder.append(", pointer=");
+ builder.append(pointer);
+ builder.append("]");
+ return builder.toString();
+...
[truncated message content] |
|
From: <luc...@us...> - 2012-05-08 09:26:44
|
Revision: 3078
http://joafip.svn.sourceforge.net/joafip/?rev=3078&view=rev
Author: luc_peuvrier
Date: 2012-05-08 09:26:36 +0000 (Tue, 08 May 2012)
Log Message:
-----------
WIP btree plus: PMD warning corrections
Modified Paths:
--------------
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractDeleter.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractSearcher.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/CheckRandomList.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/CreateRandomList.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusIntigrityCheck.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/DataBlock.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/DataBlockPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/HeaderPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/IntegrityCheckResult.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/LeafPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/NonTerminalPage.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/entity/PageNode.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataManager.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusDataMgrIntegrityChecker.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusElementMgr.java
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusIterator.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/BigKey.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/DataBlockPageTest.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/LeafPageTest.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/NonTerminalPageTest.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/mock/MockDataBlock.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/mock/MockLeafPage.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/mock/MockNonTerminalPage.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/mock/MockPageRecord.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/entity/mock/MockPageRecordable.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/BtreePlusElementMgrTest.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/BtreePlusLeafPageBalanceMergeTest.java
trunk/joafip-btreeplus/src/test/java/net/sf/joafip/btreeplus/service/BtreePlusNonTerminalPageBalanceMergeTest.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/CacheMap.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/CacheMap2.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/ToWriteIterator.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/ToWriteIterator2.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirect.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped2GBLimited.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectNio.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileCacheTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMapped2GBLimitedTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMappedTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectNioTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/TestRandomAccessFileCache.java
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestHeapElementManagerWithHeapRecord.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestHeapRecordManage.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestHeapRecordStoreRestore.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/entity/DataRecordIdentifier.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/entity/DataRecordKey.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/record/service/HeapElementManager.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/FileForStorable.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/RecordForTest.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/entity/TestDataRecordIdentifier.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/service/TestHeapElementManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/service/mock/MockFileForStorable.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/service/mock/MockHeapElementManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestDataMgrMemoryLeak.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestHeapDataManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestHeapDataManagerBackup.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestHeapDataManagerImpl.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestHeapDataManagerRecord.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/BlockDataManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/DualWrapDataManager.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/FileForStorableBridge.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/HeapMemoryDataManagerMock.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/HeapMultiFileDataManager.java
Added Paths:
-----------
trunk/joafip-btreeplus/.pmd
trunk/joafip-btreeplus/.ruleset
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|