Thread: [Joafip-svn] SF.net SVN: joafip:[3078] trunk (Page 6)
Brought to you by:
luc_peuvrier
|
From: <luc...@us...> - 2012-05-08 09:26:50
|
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
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-08 07:11:39 UTC (rev 3077)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractDeleter.java 2012-05-08 09:26:36 UTC (rev 3078)
@@ -66,7 +66,7 @@
insertLogFilePath));
// "runtime_perf/toDelete.txt"));
String line;
- while ((line = reader.readLine()) != null) {
+ while ((line = reader.readLine()) != null) {// NOPMD
reader.readLine();// skip one
final int identifier = Integer.parseInt(line);
final ItemList itemList = getItemList(session);
@@ -92,10 +92,10 @@
count = 0;
reader = new BufferedReader(new FileReader(insertLogFilePath));
// "runtime_perf/toSearch.txt"));
- while (reader.readLine() != null && (line = reader.readLine()) != null) {
+ while (reader.readLine() != null && (line = reader.readLine()) != null) {// NOPMD
final int identifier = Integer.parseInt(line);
final ItemList itemList = getItemList(session);
- Item item = itemList.get(identifier);
+ final Item item = itemList.get(identifier);
if (item == null) {
throw new FilePersistenceException("must found #" + identifier
+ " because not deleted");
@@ -116,7 +116,7 @@
count = 0;
reader = new BufferedReader(new FileReader(insertLogFilePath));
// "runtime_perf/toDelete.txt"));
- while ((line = reader.readLine()) != null) {
+ while ((line = reader.readLine()) != null) { // NOPMD
reader.readLine();// skip
final int identifier = Integer.parseInt(line);
final ItemList itemList = getItemList(session);
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-08 07:11:39 UTC (rev 3077)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractSearcher.java 2012-05-08 09:26:36 UTC (rev 3078)
@@ -80,7 +80,7 @@
inputStream));
int count = 0;
String line;
- while ((line = reader.readLine()) != null) {
+ while ((line = reader.readLine()) != null) { // NOPMD
count++;
final int identifier = Integer.parseInt(line);
final ItemList itemList = getItemList(session);
Modified: 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/CheckRandomList.java 2012-05-08 07:11:39 UTC (rev 3077)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/CheckRandomList.java 2012-05-08 09:26:36 UTC (rev 3078)
@@ -44,19 +44,19 @@
final BufferedReader reader = new BufferedReader(
new InputStreamReader(inputStream));
String line;
- while ((line = reader.readLine()) != null) {
+ while ((line = reader.readLine()) != null) { // NOPMD
final int identifier = Integer.parseInt(line);
if (!set.add(identifier)) {
- throw new Exception(identifier + " is duplicate");
+ throw new Exception(identifier + " is duplicate");// NOPMD
}
}
reader.close();
if (set.size() != AbstractPerfService.NUMBER_OF_ITEM) {
- throw new Exception(set.size() + " for "
+ throw new Exception(set.size() + " for "// NOPMD
+ AbstractPerfService.NUMBER_OF_ITEM + " expected");
}
} catch (Exception exception) {
- exception.printStackTrace();
+ exception.printStackTrace();// NOPMD
}
}
}
Modified: 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/CreateRandomList.java 2012-05-08 07:11:39 UTC (rev 3077)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/CreateRandomList.java 2012-05-08 09:26:36 UTC (rev 3078)
@@ -36,13 +36,13 @@
*/
public class CreateRandomList {
- public static void main(String[] args) {
+ public static void main(final String[] args) {
try {
final List<Integer> list = new PTreeList<Integer>();
for (int identifier = 0; identifier < AbstractPerfService.NUMBER_OF_ITEM; identifier++) {
list.add(identifier);
}
- PrintWriter allWriter = new PrintWriter(
+ final PrintWriter allWriter = new PrintWriter(
"src/main/resources/all.txt");
PrintWriter writer = new PrintWriter(
"src/main/resources/firstHalf.txt");
@@ -51,7 +51,7 @@
for (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);
+ final int identifier = list.remove(index);
writer.println(identifier);
allWriter.println(identifier);
}
@@ -60,14 +60,14 @@
for (; count < AbstractPerfService.NUMBER_OF_ITEM; count++) {
final int upperBound = list.size();
final int index = random.nextInt(upperBound);
- int identifier = list.remove(index);
+ final int identifier = list.remove(index);
writer.println(identifier);
allWriter.println(identifier);
}
writer.close();
allWriter.close();
} catch (Exception e) {
- e.printStackTrace();
+ e.printStackTrace();// NOPMD
}
}
}
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-08 07:11:39 UTC (rev 3077)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/DeleterBtreePlus.java 2012-05-08 09:26:36 UTC (rev 3078)
@@ -54,6 +54,7 @@
private final static JoafipLogger LOGGER = JoafipLogger
.getLogger(DeleterBtreePlus.class);
+ @SuppressWarnings("PMD")
@Override
protected void consistencyCheck() throws HeapException,
FilePersistenceException {
@@ -99,7 +100,7 @@
public static void main(final String[] args) {
try {
- DeleterBtreePlus deleter = new DeleterBtreePlus();
+ final DeleterBtreePlus deleter = new DeleterBtreePlus();
deleter.run();
} catch (final Throwable throwable) {// NOPMD catch all
LOGGER.fatal("error", throwable);
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-08 07:11:39 UTC (rev 3077)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterBtreePlusIntigrityCheck.java 2012-05-08 09:26:36 UTC (rev 3078)
@@ -13,6 +13,7 @@
private static final JoafipLogger LOGGER = JoafipLogger
.getLogger(InserterBtreePlusIntigrityCheck.class);
+ @SuppressWarnings("PMD")
@Override
protected void consistencyCheck() throws HeapException,
FilePersistenceException {
@@ -29,7 +30,7 @@
public static void main(final String[] args) {
try {
- InserterBtreePlusIntigrityCheck inserter = new InserterBtreePlusIntigrityCheck();
+ final InserterBtreePlusIntigrityCheck inserter = new InserterBtreePlusIntigrityCheck();
inserter.run();
inserter.close();
} catch (final Throwable throwable) {// NOPMD catch all
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-08 07:11:39 UTC (rev 3077)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/SearcherBtreePlus.java 2012-05-08 09:26:36 UTC (rev 3078)
@@ -68,7 +68,7 @@
public static void main(final String[] args) {
try {
- SearcherBtreePlus searcher = new SearcherBtreePlus();
+ final SearcherBtreePlus searcher = new SearcherBtreePlus();
searcher.run();
} catch (final Throwable throwable) {// NOPMD catch all
LOGGER.fatal("error", throwable);
Added: trunk/joafip-btreeplus/.pmd
===================================================================
--- trunk/joafip-btreeplus/.pmd (rev 0)
+++ trunk/joafip-btreeplus/.pmd 2012-05-08 09:26:36 UTC (rev 3078)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pmd>
+ <useProjectRuleSet>true</useProjectRuleSet>
+ <ruleSetFile>../joafip-parent/pmd/.ruleset</ruleSetFile>
+ <includeDerivedFiles>false</includeDerivedFiles>
+ <violationsAsErrors>false</violationsAsErrors>
+</pmd>
Added: trunk/joafip-btreeplus/.ruleset
===================================================================
--- trunk/joafip-btreeplus/.ruleset (rev 0)
+++ trunk/joafip-btreeplus/.ruleset 2012-05-08 09:26:36 UTC (rev 3078)
@@ -0,0 +1,224 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<ruleset xmlns="http://pmd.sf.net/ruleset/1.0.0" name="pmd-eclipse" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd" xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd">
+ <description>PMD Plugin preferences rule set</description>
+ <rule ref="rulesets/typeresolution.xml/LooseCoupling"/>
+ <rule ref="rulesets/typeresolution.xml/CloneMethodMustImplementCloneable"/>
+ <rule ref="rulesets/typeresolution.xml/UnusedImports"/>
+ <rule ref="rulesets/typeresolution.xml/SignatureDeclareThrowsException"/>
+ <rule ref="rulesets/basic.xml/EmptyCatchBlock"/>
+ <rule ref="rulesets/basic.xml/EmptyIfStmt"/>
+ <rule ref="rulesets/basic.xml/EmptyWhileStmt"/>
+ <rule ref="rulesets/basic.xml/EmptyTryBlock"/>
+ <rule ref="rulesets/basic.xml/EmptyFinallyBlock"/>
+ <rule ref="rulesets/basic.xml/EmptySwitchStatements"/>
+ <rule ref="rulesets/basic.xml/JumbledIncrementer"/>
+ <rule ref="rulesets/basic.xml/ForLoopShouldBeWhileLoop"/>
+ <rule ref="rulesets/basic.xml/UnnecessaryConversionTemporary"/>
+ <rule ref="rulesets/basic.xml/OverrideBothEqualsAndHashcode"/>
+ <rule ref="rulesets/basic.xml/DoubleCheckedLocking"/>
+ <rule ref="rulesets/basic.xml/ReturnFromFinallyBlock"/>
+ <rule ref="rulesets/basic.xml/EmptySynchronizedBlock"/>
+ <rule ref="rulesets/basic.xml/UnnecessaryReturn"/>
+ <rule ref="rulesets/basic.xml/EmptyStaticInitializer"/>
+ <rule ref="rulesets/basic.xml/UnconditionalIfStatement"/>
+ <rule ref="rulesets/basic.xml/EmptyStatementNotInLoop"/>
+ <rule ref="rulesets/basic.xml/BooleanInstantiation"/>
+ <rule ref="rulesets/basic.xml/UnnecessaryFinalModifier"/>
+ <rule ref="rulesets/basic.xml/CollapsibleIfStatements"/>
+ <rule ref="rulesets/basic.xml/UselessOverridingMethod"/>
+ <rule ref="rulesets/basic.xml/ClassCastExceptionWithToArray"/>
+ <rule ref="rulesets/basic.xml/AvoidDecimalLiteralsInBigDecimalConstructor"/>
+ <rule ref="rulesets/basic.xml/UselessOperationOnImmutable"/>
+ <rule ref="rulesets/basic.xml/MisplacedNullCheck"/>
+ <rule ref="rulesets/basic.xml/UnusedNullCheckInEquals"/>
+ <rule ref="rulesets/basic.xml/AvoidThreadGroup"/>
+ <rule ref="rulesets/basic.xml/BrokenNullCheck"/>
+ <rule ref="rulesets/basic.xml/BigIntegerInstantiation"/>
+ <rule ref="rulesets/basic.xml/AvoidUsingOctalValues"/>
+ <rule ref="rulesets/basic.xml/AvoidUsingHardCodedIP"/>
+ <rule ref="rulesets/basic.xml/CheckResultSet"/>
+ <rule ref="rulesets/basic.xml/AvoidMultipleUnaryOperators"/>
+ <rule ref="rulesets/basic.xml/EmptyInitializer"/>
+ <rule ref="rulesets/braces.xml/IfStmtsMustUseBraces"/>
+ <rule ref="rulesets/braces.xml/WhileLoopsMustUseBraces"/>
+ <rule ref="rulesets/braces.xml/IfElseStmtsMustUseBraces"/>
+ <rule ref="rulesets/braces.xml/ForLoopsMustUseBraces"/>
+ <rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/>
+ <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/>
+ <rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"/>
+ <rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/>
+ <rule ref="rulesets/logging-java.xml/MoreThanOneLogger"/>
+ <rule ref="rulesets/logging-java.xml/SystemPrintln"/>
+ <rule ref="rulesets/logging-java.xml/AvoidPrintStackTrace"/>
+ <rule ref="rulesets/controversial.xml/UnnecessaryConstructor"/>
+ <rule ref="rulesets/controversial.xml/NullAssignment"/>
+ <rule ref="rulesets/controversial.xml/OnlyOneReturn"/>
+ <rule ref="rulesets/controversial.xml/UnusedModifier"/>
+ <rule ref="rulesets/controversial.xml/AssignmentInOperand"/>
+ <rule ref="rulesets/controversial.xml/AtLeastOneConstructor"/>
+ <rule ref="rulesets/controversial.xml/DontImportSun"/>
+ <rule ref="rulesets/controversial.xml/SuspiciousOctalEscape"/>
+ <rule ref="rulesets/controversial.xml/CallSuperInConstructor"/>
+ <rule ref="rulesets/controversial.xml/UnnecessaryParentheses"/>
+ <rule ref="rulesets/controversial.xml/DefaultPackage"/>
+ <rule ref="rulesets/controversial.xml/BooleanInversion"/>
+ <rule ref="rulesets/controversial.xml/DataflowAnomalyAnalysis"/>
+ <rule ref="rulesets/controversial.xml/AvoidFinalLocalVariable"/>
+ <rule ref="rulesets/controversial.xml/AvoidUsingShortType"/>
+ <rule ref="rulesets/controversial.xml/AvoidUsingVolatile"/>
+ <rule ref="rulesets/controversial.xml/AvoidUsingNativeCode"/>
+ <rule ref="rulesets/controversial.xml/AvoidAccessibilityAlteration"/>
+ <rule ref="rulesets/controversial.xml/DoNotCallGarbageCollectionExplicitly"/>
+ <rule ref="rulesets/strings.xml/AvoidDuplicateLiterals"/>
+ <rule ref="rulesets/strings.xml/StringInstantiation"/>
+ <rule ref="rulesets/strings.xml/StringToString"/>
+ <rule ref="rulesets/strings.xml/InefficientStringBuffering"/>
+ <rule ref="rulesets/strings.xml/UnnecessaryCaseChange"/>
+ <rule ref="rulesets/strings.xml/UseStringBufferLength"/>
+ <rule ref="rulesets/strings.xml/AppendCharacterWithChar"/>
+ <rule ref="rulesets/strings.xml/ConsecutiveLiteralAppends"/>
+ <rule ref="rulesets/strings.xml/UseIndexOfChar"/>
+ <rule ref="rulesets/strings.xml/InefficientEmptyStringCheck"/>
+ <rule ref="rulesets/strings.xml/InsufficientStringBufferDeclaration"/>
+ <rule ref="rulesets/strings.xml/UselessStringValueOf"/>
+ <rule ref="rulesets/strings.xml/StringBufferInstantiationWithChar"/>
+ <rule ref="rulesets/strings.xml/UseEqualsToCompareStrings"/>
+ <rule ref="rulesets/strings.xml/AvoidStringBufferField"/>
+ <rule ref="rulesets/strictexception.xml/AvoidCatchingThrowable"/>
+ <rule ref="rulesets/strictexception.xml/SignatureDeclareThrowsException"/>
+ <rule ref="rulesets/strictexception.xml/ExceptionAsFlowControl"/>
+ <rule ref="rulesets/strictexception.xml/AvoidCatchingNPE"/>
+ <rule ref="rulesets/strictexception.xml/AvoidThrowingRawExceptionTypes"/>
+ <rule ref="rulesets/strictexception.xml/AvoidThrowingNullPointerException"/>
+ <rule ref="rulesets/strictexception.xml/AvoidRethrowingException"/>
+ <rule ref="rulesets/strictexception.xml/DoNotExtendJavaLangError"/>
+ <rule ref="rulesets/strictexception.xml/DoNotThrowExceptionInFinally"/>
+ <rule ref="rulesets/migrating.xml/ReplaceVectorWithList"/>
+ <rule ref="rulesets/migrating.xml/ReplaceHashtableWithMap"/>
+ <rule ref="rulesets/migrating.xml/ReplaceEnumerationWithIterator"/>
+ <rule ref="rulesets/migrating.xml/AvoidEnumAsIdentifier"/>
+ <rule ref="rulesets/migrating.xml/AvoidAssertAsIdentifier"/>
+ <rule ref="rulesets/migrating.xml/IntegerInstantiation"/>
+ <rule ref="rulesets/migrating.xml/ByteInstantiation"/>
+ <rule ref="rulesets/migrating.xml/ShortInstantiation"/>
+ <rule ref="rulesets/migrating.xml/LongInstantiation"/>
+ <rule ref="rulesets/migrating.xml/JUnit4TestShouldUseBeforeAnnotation"/>
+ <rule ref="rulesets/migrating.xml/JUnit4TestShouldUseAfterAnnotation"/>
+ <rule ref="rulesets/migrating.xml/JUnit4TestShouldUseTestAnnotation"/>
+ <rule ref="rulesets/migrating.xml/JUnit4SuitesShouldUseSuiteAnnotation"/>
+ <rule ref="rulesets/migrating.xml/JUnitUseExpected"/>
+ <rule ref="rulesets/optimizations.xml/LocalVariableCouldBeFinal"/>
+ <rule ref="rulesets/optimizations.xml/MethodArgumentCouldBeFinal"/>
+ <rule ref="rulesets/optimizations.xml/AvoidInstantiatingObjectsInLoops"/>
+ <rule ref="rulesets/optimizations.xml/UseArrayListInsteadOfVector"/>
+ <rule ref="rulesets/optimizations.xml/SimplifyStartsWith"/>
+ <rule ref="rulesets/optimizations.xml/UseStringBufferForStringAppends"/>
+ <rule ref="rulesets/optimizations.xml/UseArraysAsList"/>
+ <rule ref="rulesets/optimizations.xml/AvoidArrayLoops"/>
+ <rule ref="rulesets/optimizations.xml/UnnecessaryWrapperObjectCreation"/>
+ <rule ref="rulesets/optimizations.xml/AddEmptyString"/>
+ <rule ref="rulesets/sunsecure.xml/MethodReturnsInternalArray"/>
+ <rule ref="rulesets/sunsecure.xml/ArrayIsStoredDirectly"/>
+ <rule ref="rulesets/coupling.xml/CouplingBetweenObjects"/>
+ <rule ref="rulesets/coupling.xml/ExcessiveImports"/>
+ <rule ref="rulesets/coupling.xml/LooseCoupling"/>
+ <rule ref="rulesets/imports.xml/DuplicateImports"/>
+ <rule ref="rulesets/imports.xml/DontImportJavaLang"/>
+ <rule ref="rulesets/imports.xml/UnusedImports"/>
+ <rule ref="rulesets/imports.xml/ImportFromSamePackage"/>
+ <rule ref="rulesets/imports.xml/TooManyStaticImports"/>
+ <rule ref="rulesets/junit.xml/JUnitStaticSuite"/>
+ <rule ref="rulesets/junit.xml/JUnitSpelling"/>
+ <rule ref="rulesets/junit.xml/JUnitAssertionsShouldIncludeMessage"/>
+ <rule ref="rulesets/junit.xml/JUnitTestsShouldIncludeAssert"/>
+ <rule ref="rulesets/junit.xml/TestClassWithoutTestCases"/>
+ <rule ref="rulesets/junit.xml/UnnecessaryBooleanAssertion"/>
+ <rule ref="rulesets/junit.xml/UseAssertEqualsInsteadOfAssertTrue"/>
+ <rule ref="rulesets/junit.xml/UseAssertSameInsteadOfAssertTrue"/>
+ <rule ref="rulesets/junit.xml/UseAssertNullInsteadOfAssertTrue"/>
+ <rule ref="rulesets/junit.xml/SimplifyBooleanAssertion"/>
+ <rule ref="rulesets/naming.xml/ShortVariable"/>
+ <rule ref="rulesets/naming.xml/LongVariable"/>
+ <rule ref="rulesets/naming.xml/ShortMethodName"/>
+ <rule ref="rulesets/naming.xml/AbstractNaming"/>
+ <rule ref="rulesets/naming.xml/AvoidDollarSigns"/>
+ <rule ref="rulesets/naming.xml/MethodWithSameNameAsEnclosingClass"/>
+ <rule ref="rulesets/naming.xml/SuspiciousHashcodeMethodName"/>
+ <rule ref="rulesets/naming.xml/SuspiciousConstantFieldName"/>
+ <rule ref="rulesets/naming.xml/SuspiciousEqualsMethodName"/>
+ <rule ref="rulesets/naming.xml/AvoidFieldNameMatchingTypeName"/>
+ <rule ref="rulesets/naming.xml/AvoidFieldNameMatchingMethodName"/>
+ <rule ref="rulesets/naming.xml/NoPackage"/>
+ <rule ref="rulesets/naming.xml/PackageCase"/>
+ <rule ref="rulesets/naming.xml/MisleadingVariableName"/>
+ <rule ref="rulesets/naming.xml/BooleanGetMethodName"/>
+ <rule ref="rulesets/codesize.xml/ExcessiveMethodLength"/>
+ <rule ref="rulesets/codesize.xml/ExcessiveParameterList"/>
+ <rule ref="rulesets/codesize.xml/ExcessiveClassLength"/>
+ <rule ref="rulesets/codesize.xml/ExcessivePublicCount"/>
+ <rule ref="rulesets/codesize.xml/NcssMethodCount"/>
+ <rule ref="rulesets/codesize.xml/NcssTypeCount"/>
+ <rule ref="rulesets/codesize.xml/NcssConstructorCount"/>
+ <rule ref="rulesets/codesize.xml/TooManyMethods"/>
+ <rule ref="rulesets/finalizers.xml/EmptyFinalizer"/>
+ <rule ref="rulesets/finalizers.xml/FinalizeOnlyCallsSuperFinalize"/>
+ <rule ref="rulesets/finalizers.xml/FinalizeOverloaded"/>
+ <rule ref="rulesets/finalizers.xml/FinalizeDoesNotCallSuperFinalize"/>
+ <rule ref="rulesets/finalizers.xml/FinalizeShouldBeProtected"/>
+ <rule ref="rulesets/finalizers.xml/AvoidCallingFinalize"/>
+ <rule ref="rulesets/logging-jakarta-commons.xml/UseCorrectExceptionLogging"/>
+ <rule ref="rulesets/logging-jakarta-commons.xml/ProperLogger"/>
+ <rule ref="rulesets/javabeans.xml/BeanMembersShouldSerialize"/>
+ <rule ref="rulesets/javabeans.xml/MissingSerialVersionUID"/>
+ <rule ref="rulesets/clone.xml/ProperCloneImplementation"/>
+ <rule ref="rulesets/clone.xml/CloneThrowsCloneNotSupportedException"/>
+ <rule ref="rulesets/clone.xml/CloneMethodMustImplementCloneable"/>
+ <rule ref="rulesets/design.xml/UseSingleton"/>
+ <rule ref="rulesets/design.xml/SimplifyBooleanReturns"/>
+ <rule ref="rulesets/design.xml/SimplifyBooleanExpressions"/>
+ <rule ref="rulesets/design.xml/SwitchStmtsShouldHaveDefault"/>
+ <rule ref="rulesets/design.xml/AvoidDeeplyNestedIfStmts"/>
+ <rule ref="rulesets/design.xml/AvoidReassigningParameters"/>
+ <rule ref="rulesets/design.xml/SwitchDensity"/>
+ <rule ref="rulesets/design.xml/ConstructorCallsOverridableMethod"/>
+ <rule ref="rulesets/design.xml/AccessorClassGeneration"/>
+ <rule ref="rulesets/design.xml/FinalFieldCouldBeStatic"/>
+ <rule ref="rulesets/design.xml/CloseResource"/>
+ <rule ref="rulesets/design.xml/NonStaticInitializer"/>
+ <rule ref="rulesets/design.xml/DefaultLabelNotLastInSwitchStmt"/>
+ <rule ref="rulesets/design.xml/NonCaseLabelInSwitchStatement"/>
+ <rule ref="rulesets/design.xml/OptimizableToArrayCall"/>
+ <rule ref="rulesets/design.xml/BadComparison"/>
+ <rule ref="rulesets/design.xml/EqualsNull"/>
+ <rule ref="rulesets/design.xml/ConfusingTernary"/>
+ <rule ref="rulesets/design.xml/InstantiationToGetClass"/>
+ <rule ref="rulesets/design.xml/IdempotentOperations"/>
+ <rule ref="rulesets/design.xml/SimpleDateFormatNeedsLocale"/>
+ <rule ref="rulesets/design.xml/ImmutableField"/>
+ <rule ref="rulesets/design.xml/UseLocaleWithCaseConversions"/>
+ <rule ref="rulesets/design.xml/AvoidProtectedFieldInFinalClass"/>
+ <rule ref="rulesets/design.xml/AssignmentToNonFinalStatic"/>
+ <rule ref="rulesets/design.xml/MissingStaticMethodInNonInstantiatableClass"/>
+ <rule ref="rulesets/design.xml/AvoidSynchronizedAtMethodLevel"/>
+ <rule ref="rulesets/design.xml/MissingBreakInSwitch"/>
+ <rule ref="rulesets/design.xml/UseNotifyAllInsteadOfNotify"/>
+ <rule ref="rulesets/design.xml/AvoidInstanceofChecksInCatchClause"/>
+ <rule ref="rulesets/design.xml/AbstractClassWithoutAbstractMethod"/>
+ <rule ref="rulesets/design.xml/SimplifyConditional"/>
+ <rule ref="rulesets/design.xml/CompareObjectsWithEquals"/>
+ <rule ref="rulesets/design.xml/PositionLiteralsFirstInComparisons"/>
+ <rule ref="rulesets/design.xml/UnnecessaryLocalBeforeReturn"/>
+ <rule ref="rulesets/design.xml/NonThreadSafeSingleton"/>
+ <rule ref="rulesets/design.xml/UncommentedEmptyMethod"/>
+ <rule ref="rulesets/design.xml/UncommentedEmptyConstructor"/>
+ <rule ref="rulesets/design.xml/AvoidConstantsInterface"/>
+ <rule ref="rulesets/design.xml/UnsynchronizedStaticDateFormatter"/>
+ <rule ref="rulesets/design.xml/PreserveStackTrace"/>
+ <rule ref="rulesets/design.xml/UseCollectionIsEmpty"/>
+ <rule ref="rulesets/design.xml/ClassWithOnlyPrivateConstructorsShouldBeFinal"/>
+ <rule ref="rulesets/design.xml/EmptyMethodInAbstractClassShouldBeAbstract"/>
+ <rule re...
[truncated message content] |
|
From: <luc...@us...> - 2012-05-11 03:41:57
|
Revision: 3083
http://joafip.svn.sourceforge.net/joafip/?rev=3083&view=rev
Author: luc_peuvrier
Date: 2012-05-11 03:41:49 +0000 (Fri, 11 May 2012)
Log Message:
-----------
mapped random file access: bug corrected could have out of memory
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/XmlExporter.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/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/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/StoreForTest.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/ToWriteIterator.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/EnumFileAccessMode.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/FileForStorable.java
trunk/joafip-meminspector/src/main/java/net/sf/joafip/meminspector/service/inspect/MemInspector.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/file/FileTests.java
Added Paths:
-----------
trunk/joafip-4test/src/main/java/net/sf/joafip/file/
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWrite1Gbyte.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStream.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamMapped.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamNIO.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/MappedByteBufferNode.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/AbstractFileOutputStreamOnRandomFile.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/FileOutputStreamMapped.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/FileOutputStreamNIO.java
Removed Paths:
-------------
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileOutputStreamNIO.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/RandomFileDirectMapped2GBLimitedTest.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-11 03:41:59
|
Revision: 3083
http://joafip.svn.sourceforge.net/joafip/?rev=3083&view=rev
Author: luc_peuvrier
Date: 2012-05-11 03:41:49 +0000 (Fri, 11 May 2012)
Log Message:
-----------
mapped random file access: bug corrected could have out of memory
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/XmlExporter.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/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/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/StoreForTest.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/ToWriteIterator.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/EnumFileAccessMode.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/FileForStorable.java
trunk/joafip-meminspector/src/main/java/net/sf/joafip/meminspector/service/inspect/MemInspector.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/file/FileTests.java
Added Paths:
-----------
trunk/joafip-4test/src/main/java/net/sf/joafip/file/
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWrite1Gbyte.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStream.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamMapped.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamNIO.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/MappedByteBufferNode.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/AbstractFileOutputStreamOnRandomFile.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/FileOutputStreamMapped.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/FileOutputStreamNIO.java
Removed Paths:
-------------
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileOutputStreamNIO.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/RandomFileDirectMapped2GBLimitedTest.java
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-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -185,8 +185,6 @@
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 {
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/XmlExporter.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/XmlExporter.java 2012-05-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/XmlExporter.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -23,7 +23,7 @@
import java.io.OutputStream;
import net.sf.joafip.NotStorableClass;
-import net.sf.joafip.file.service.FileOutputStreamNIO;
+import net.sf.joafip.file.service.stream.FileOutputStreamNIO;
import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
import net.sf.joafip.store.entity.classinfo.ClassInfo;
import net.sf.joafip.store.service.IStore;
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-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestCustomObjectIO.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -50,7 +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.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
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-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestSerializable.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -62,7 +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.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
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-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestBobSerializeStackOverflow.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -61,7 +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.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
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-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestClear.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -58,7 +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.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
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-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestCrashSafe.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -171,7 +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.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
@@ -201,7 +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.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
@@ -227,7 +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.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestExportImport.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestExportImport.java 2012-05-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestExportImport.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -69,7 +69,7 @@
// filePersistence = new FilePersistence(1, null,
// TestConstant.getRuntimeDir(), true, false);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(true);
@@ -165,7 +165,7 @@
// filePersistence = new FilePersistence(1, null, RUNTIME, true, false);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setProxyMode(true);
builder.setRemoveFiles(true);
builder.setGarbageManagement(false);
@@ -275,7 +275,7 @@
filePersistence.close();
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(true);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestExportObject.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestExportObject.java 2012-05-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestExportObject.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -74,7 +74,7 @@
// filePersistence = new FilePersistence(1, null,
// TestConstant.getRuntimeDir(), true, false);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(true);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceNoG.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceNoG.java 2012-05-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceNoG.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -27,7 +27,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.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(path.getPath());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceOpenClose.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceOpenClose.java 2012-05-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceOpenClose.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -120,7 +120,7 @@
// /**/false/* do not remove files */,
// /**/true/* manage garbage */);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(path.getPath());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceWithG.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceWithG.java 2012-05-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceWithG.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -24,7 +24,7 @@
// /**/false/* do not remove files */,
// /**/true/* manage garbage */);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(path.getPath());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestInnerClassProxy.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestInnerClassProxy.java 2012-05-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestInnerClassProxy.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -66,7 +66,7 @@
// final FilePersistence filePersistence = new FilePersistence(1, null,
// TestConstant.getRuntimeDir(), true, false);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestMultiAccessFilePersistence.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestMultiAccessFilePersistence.java 2012-05-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestMultiAccessFilePersistence.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -54,7 +54,7 @@
// /**/true/* remove files */,
// /**/true/* manage garbage */);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(path.getPath());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestMultipleFilePersistenceInstance.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestMultipleFilePersistenceInstance.java 2012-05-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestMultipleFilePersistenceInstance.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -110,7 +110,7 @@
// filePersistence = new FilePersistence(1, null,
// TestConstant.getRuntimeDir(), false, false);
FilePersistenceBuilder builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
@@ -126,7 +126,7 @@
// filePersistence = new FilePersistence(1, null,
// TestConstant.getRuntimeDir(), false, false);
builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
@@ -164,7 +164,7 @@
// filePersistence = new FilePersistence(1, null,
// TestConstant.getRuntimeDir(), false, false);
FilePersistenceBuilder builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
@@ -185,7 +185,7 @@
// filePersistence = new FilePersistence(1, null,
// TestConstant.getRuntimeDir(), false, false);
builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
@@ -223,7 +223,7 @@
// filePersistence = new FilePersistence(1, null,
// TestConstant.getRuntimeDir(), false, false);
FilePersistenceBuilder builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
@@ -245,7 +245,7 @@
// filePersistence = new FilePersistence(1, null,
// TestConstant.getRuntimeDir(), false, false);
builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
@@ -282,7 +282,7 @@
// filePersistence = new FilePersistence(1, null,
// TestConstant.getRuntimeDir(), true, true);
FilePersistenceBuilder builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(true);
@@ -298,7 +298,7 @@
// filePersistence = new FilePersistence(1, null,
// TestConstant.getRuntimeDir(), true, false);
builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestSaveFailureDoNotModifyStorage.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestSaveFailureDoNotModifyStorage.java 2012-05-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestSaveFailureDoNotModifyStorage.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -65,7 +65,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.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(path.getPath());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestStoreNotStorable.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestStoreNotStorable.java 2012-05-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestStoreNotStorable.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -54,7 +54,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.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(path.getPath());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestVisitedModified.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestVisitedModified.java 2012-05-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestVisitedModified.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -67,7 +67,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.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(path.getPath());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/bug/AbstractFileCheckPersistenceForTest.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/bug/AbstractFileCheckPersistenceForTest.java 2012-05-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/bug/AbstractFileCheckPersistenceForTest.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -56,7 +56,7 @@
// * crash safe
// */);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/bug/AbstractFilePersistenceForTest.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/bug/AbstractFilePersistenceForTest.java 2012-05-09 04:56:39 UTC (rev 3082)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/bug/AbstractFilePersistenceForTest.java 2012-05-11 03:41:49 UTC (rev 3083)
@@ -49,7 +49,7 @@
super.setUp();
// filePersistence = new FilePersistence(1, null, path, false, true);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
- builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS_2GBYTE_MAX);
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setPathName(path.getPath());
builder.setRemoveFiles(false);
builder.setGarbageManagement(true);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestBugChangeLog.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestBugChangeLog.java 2012-05-09 04:56:39 UTC (rev 3082)
+++ tru...
[truncated message content] |
|
From: <luc...@us...> - 2012-05-12 00:19:39
|
Revision: 3085
http://joafip.svn.sourceforge.net/joafip/?rev=3085&view=rev
Author: luc_peuvrier
Date: 2012-05-12 00:19:32 +0000 (Sat, 12 May 2012)
Log Message:
-----------
file management optimization
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/in/XmlImporter.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestExclusiveDataAccessSessionUsingProps.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractTestStoreMemoryLeak.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStream.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamMapped.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/AbstractFileOutputStreamOnRandomFile.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
Added Paths:
-----------
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWriteRead1Gbyte.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStream.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStreamNIO.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/AbstractFileInputStreamOnRandomFile.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/FileInputStreamNIO.java
Removed Paths:
-------------
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWrite1Gbyte.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamNIO.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-12 00:19:40
|
Revision: 3085
http://joafip.svn.sourceforge.net/joafip/?rev=3085&view=rev
Author: luc_peuvrier
Date: 2012-05-12 00:19:32 +0000 (Sat, 12 May 2012)
Log Message:
-----------
file management optimization
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/in/XmlImporter.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestExclusiveDataAccessSessionUsingProps.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractTestStoreMemoryLeak.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStream.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamMapped.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/AbstractFileOutputStreamOnRandomFile.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
Added Paths:
-----------
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWriteRead1Gbyte.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStream.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStreamNIO.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/AbstractFileInputStreamOnRandomFile.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/FileInputStreamNIO.java
Removed Paths:
-------------
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWrite1Gbyte.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamNIO.java
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-11 03:46:15 UTC (rev 3084)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java 2012-05-12 00:19:32 UTC (rev 3085)
@@ -188,10 +188,8 @@
} else if ("mapped".equals(value)) {
fileAccessMode = EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS;
} else {
- throw new FilePersistenceException(
- "bad value \""
- + value
- + "\",random, nio, mapped2Gb, or mapped expected");
+ throw new FilePersistenceException("bad value \""
+ + value + "\",random, nio, or mapped expected");
}
filePersistenceProperties.setFileAccessMode(fileAccessMode);
} else if (JOAFIP_PATH.equals(key)) {
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/in/XmlImporter.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/in/XmlImporter.java 2012-05-11 03:46:15 UTC (rev 3084)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/in/XmlImporter.java 2012-05-12 00:19:32 UTC (rev 3085)
@@ -18,6 +18,7 @@
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Deque;
@@ -28,6 +29,7 @@
import javax.xml.parsers.SAXParserFactory;
import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.file.service.stream.FileInputStreamNIO;
import net.sf.joafip.store.service.IStore;
import org.xml.sax.Attributes;
@@ -89,8 +91,9 @@
final XMLReader reader = saxParser.getXMLReader();
reader.setErrorHandler(new XmlReaderErrorHandler(this));
reader.setContentHandler(this);
- final String sourcePath = exportFile.toURI().toString();
- reader.parse(new InputSource(sourcePath));
+ // final String sourcePath = exportFile.toURI().toString();
+ final InputStream inputStream = new FileInputStreamNIO(exportFile);
+ reader.parse(new InputSource(inputStream));
} catch (SAXException exception) {
final String message = exception.getMessage();
final Exception embeddedException = exception.getException();
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestExclusiveDataAccessSessionUsingProps.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestExclusiveDataAccessSessionUsingProps.java 2012-05-11 03:46:15 UTC (rev 3084)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestExclusiveDataAccessSessionUsingProps.java 2012-05-12 00:19:32 UTC (rev 3085)
@@ -27,6 +27,7 @@
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
+import java.lang.reflect.Method;
import net.sf.joafip.AbstractDeleteFileTestCase;
import net.sf.joafip.NotStorableClass;
@@ -129,7 +130,7 @@
FilePersistenceDataCorruptedException, FileNotFoundException,
TestException {
initialize(new String[] {
- /**/"joafip.fileAccessMode=mapped2Gb",
+ /**/"joafip.fileAccessMode=mapped",
/**/"joafip.path=" + TestConstant.getWinRamDiskRuntimeDir(),
/**/"joafip.dataModelIdentifier=1",
/**/"joafip.proxyMode=enabled",
@@ -150,6 +151,9 @@
TestException {
initialize();
+ final Method method = Bob1.class.getDeclaredMethod(
+ "doSomethingOnOtherBob1Private", new Class<?>[] { Bob1.class });
+ filePersistence.addToNotCheckMethod(method);
dataAccessSession.open();
BobContainer bobContainer = initialBobContainer();
assertTrue("bobContainer be a proxy",
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractTestStoreMemoryLeak.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractTestStoreMemoryLeak.java 2012-05-11 03:46:15 UTC (rev 3084)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractTestStoreMemoryLeak.java 2012-05-12 00:19:32 UTC (rev 3085)
@@ -9,11 +9,13 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
+import net.sf.joafip.file.service.RandomAccessFileDirectMapped;
import net.sf.joafip.file.service.RandomAccessFileReadWriteCache;
import net.sf.joafip.java.util.PTreeSet;
import net.sf.joafip.meminspector.service.MemInspectorException;
import net.sf.joafip.meminspector.service.inspect.MemInspector;
import net.sf.joafip.store.entity.StoreHeader;
+import net.sf.joafip.store.service.bytecode.proxy.CheckMethodListener;
@NotStorableClass
@StorableAccess
@@ -62,6 +64,8 @@
memInspector.setMainPackageName("net.sf.joafip");
memInspector.addExcludedClass(StoreHeader.class);
memInspector.addDoNotInspectClass(RandomAccessFileReadWriteCache.class);
+ memInspector.addDoNotInspectClass(RandomAccessFileDirectMapped.class);
+ memInspector.addExcludedClass(CheckMethodListener.class);
helperMemoryUse.log("start");
PTreeSet<String> set = new PTreeSet<String>();
set.add("a");
@@ -84,9 +88,13 @@
helperMemoryUse.log("added " + i);
memInspector.inspect(store, true);
if (memInspector.added()) {
+ // PrintStream stream = new PrintStream("logs"// NOPMD
+ // + File.separator + "log_mem_start.txt");
stream = new PrintStream("logs"// NOPMD
+ File.separator + "log_mem_leak.txt");
memInspector.log(stream);
+ memInspector.serialize(new File("logs" + File.separator// NOPMD
+ + "log_mem_leak.bin"));
stream.close();
fail("object stay in memory iteration #" + i);
}
Deleted: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWrite1Gbyte.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWrite1Gbyte.java 2012-05-11 03:46:15 UTC (rev 3084)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWrite1Gbyte.java 2012-05-12 00:19:32 UTC (rev 3085)
@@ -1,64 +0,0 @@
-/*
- * 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.OutputStream;
-
-/**
- *
- * @author luc peuvrier
- *
- */
-public abstract class AbstractWrite1Gbyte {
-
- private static final byte[] DATA = new byte[1024];
-
- private final OutputStream outputStream;
-
- public AbstractWrite1Gbyte(final OutputStream outputStream) {
- super();
- this.outputStream = outputStream;
- }
-
- /**
- *
- * @return mS 1 giga byte write duration
- * @throws Exception
- * @throws IOException
- */
- protected long write() throws Exception {// NOPMD
- int count = -1;
- try {
- final long beginTime = System.currentTimeMillis();
- for (count = 0; count < 1024 * 1024; count++) {
- outputStream.write(DATA);
- }
- outputStream.close();
- return System.currentTimeMillis() - beginTime;
- } catch (Exception exception) {
- throw new Exception("count " + count + ", size "// NOPMD
- + (count * DATA.length), exception);
- }
- }
-}
Copied: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWriteRead1Gbyte.java (from rev 3083, trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWrite1Gbyte.java)
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWriteRead1Gbyte.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWriteRead1Gbyte.java 2012-05-12 00:19:32 UTC (rev 3085)
@@ -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.file.service;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Arrays;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public abstract class AbstractWriteRead1Gbyte {
+
+ private static final byte[] DATA = new byte[1024];
+
+ static {
+ for (int index = 0; index < 1024; index++) {
+ DATA[index] = (byte) index;
+ }
+ }
+
+ /**
+ *
+ * @return mS 1 giga byte write duration
+ * @throws Exception
+ * @throws IOException
+ */
+ protected long write(final OutputStream outputStream) throws Exception {// NOPMD
+ int count = -1;
+ try {
+ final long beginTime = System.currentTimeMillis();
+ for (count = 0; count < 1024 * 1024; count++) {
+ outputStream.write(DATA);
+ }
+ outputStream.close();
+ return System.currentTimeMillis() - beginTime;
+ } catch (Exception exception) {
+ throw new Exception("count " + count + ", size "// NOPMD
+ + (count * DATA.length), exception);
+ }
+ }
+
+ protected long read(final InputStream inputStream) throws Exception {// NOPMD
+ int count = -1;
+ try {
+ final byte[] data = new byte[1024];
+ final long beginTime = System.currentTimeMillis();
+ for (count = 0; count < 1024 * 1024; count++) {
+ final int read = inputStream.read(data);
+ if (read != 1024) {
+ throw new Exception("must read 1024 bytes");// NOPMD
+ }
+ if (!Arrays.equals(data, DATA)) {
+ throw new Exception("bad data");// NOPMD
+ }
+ }
+ final int read = inputStream.read(data);
+ if (read != -1) {
+ throw new Exception("must be end of file");// NOPMD
+ }
+ inputStream.close();
+ return System.currentTimeMillis() - beginTime;
+ } catch (Exception exception) {
+ throw new Exception("count " + count + ", size "// NOPMD
+ + (count * DATA.length), exception);
+ }
+ }
+}
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStream.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStream.java 2012-05-11 03:46:15 UTC (rev 3084)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStream.java 2012-05-12 00:19:32 UTC (rev 3085)
@@ -24,28 +24,33 @@
package net.sf.joafip.file.service;
import java.io.File;
+import java.io.FileInputStream;
import java.io.FileOutputStream;
+import java.io.InputStream;
import java.io.OutputStream;
+import net.sf.joafip.NotStorableClass;
+
/**
*
* @author luc peuvrier
*
*/
-public class MainWrite1GByteFileOutputStream extends AbstractWrite1Gbyte {
+@NotStorableClass
+public class MainWrite1GByteFileOutputStream extends AbstractWriteRead1Gbyte {
- public MainWrite1GByteFileOutputStream(final OutputStream outputStream) {
- super(outputStream);
- }
-
+ @SuppressWarnings("PMD")
public static void main(final String[] args) {
try {
final File file = new File("runtime/1gb.bin");
file.delete();
+ final MainWriteRead1GByteFileOutputStream main = new MainWriteRead1GByteFileOutputStream();
final OutputStream outputStream = new FileOutputStream(file);
- final MainWrite1GByteFileOutputStream main = new MainWrite1GByteFileOutputStream(
- outputStream);
- System.out.println("duration " + main.write() + " mS");// NOPMD
+ System.out.println("write duration " + main.write(outputStream)
+ + " mS");// NOPMD
+ final InputStream inputStream = new FileInputStream(file);
+ System.out.println("read duration " + main.read(inputStream)
+ + " mS");// NOPMD
} catch (Exception exception) {
exception.printStackTrace();// NOPMD
}
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamMapped.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamMapped.java 2012-05-11 03:46:15 UTC (rev 3084)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamMapped.java 2012-05-12 00:19:32 UTC (rev 3085)
@@ -33,20 +33,18 @@
* @author luc peuvrier
*
*/
-public class MainWrite1GByteFileOutputStreamMapped extends AbstractWrite1Gbyte {
+public class MainWrite1GByteFileOutputStreamMapped extends
+ AbstractWriteRead1Gbyte {
- public MainWrite1GByteFileOutputStreamMapped(final OutputStream outputStream) {
- super(outputStream);
- }
-
+ @SuppressWarnings("PMD")
public static void main(final String[] args) {
try {
final File file = new File("runtime/1gb.bin");
file.delete();
+ final MainWrite1GByteFileOutputStreamMapped main = new MainWrite1GByteFileOutputStreamMapped();
final OutputStream outputStream = new FileOutputStreamMapped(file);
- final MainWrite1GByteFileOutputStreamMapped main = new MainWrite1GByteFileOutputStreamMapped(
- outputStream);
- System.out.println("duration " + main.write() + " mS");// NOPMD
+ System.out.println("write duration " + main.write(outputStream)
+ + " mS");// NOPMD
} catch (Exception exception) {
exception.printStackTrace();// NOPMD
}
Deleted: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamNIO.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamNIO.java 2012-05-11 03:46:15 UTC (rev 3084)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamNIO.java 2012-05-12 00:19:32 UTC (rev 3085)
@@ -1,54 +0,0 @@
-/*
- * 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.OutputStream;
-
-import net.sf.joafip.file.service.stream.FileOutputStreamNIO;
-
-/**
- *
- * @author luc peuvrier
- *
- */
-public class MainWrite1GByteFileOutputStreamNIO extends AbstractWrite1Gbyte {
-
- public MainWrite1GByteFileOutputStreamNIO(final OutputStream outputStream) {
- super(outputStream);
- }
-
- public static void main(final String[] args) {
- try {
- final File file = new File("runtime/1gb.bin");
- file.delete();
- final OutputStream outputStream = new FileOutputStreamNIO(file);
- final MainWrite1GByteFileOutputStreamNIO main = new MainWrite1GByteFileOutputStreamNIO(
- outputStream);
- System.out.println("duration " + main.write() + " mS");// NOPMD
- } catch (Exception exception) {
- exception.printStackTrace();// NOPMD
- }
- }
-}
Copied: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStream.java (from rev 3083, trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStream.java)
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStream.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStream.java 2012-05-12 00:19:32 UTC (rev 3085)
@@ -0,0 +1,59 @@
+/*
+ * 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.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import net.sf.joafip.NotStorableClass;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class MainWriteRead1GByteFileOutputStream extends
+ AbstractWriteRead1Gbyte {
+
+ @SuppressWarnings("PMD")
+ public static void main(final String[] args) {
+ try {
+ final File file = new File("runtime/1gb.bin");
+ file.delete();
+ final MainWriteRead1GByteFileOutputStream main = new MainWriteRead1GByteFileOutputStream();
+ final OutputStream outputStream = new FileOutputStream(file);
+ System.out.println("write duration " + main.write(outputStream)
+ + " mS");// NOPMD
+ final InputStream inputStream = new FileInputStream(file);
+ System.out.println("read duration " + main.read(inputStream)
+ + " mS");// NOPMD
+ } catch (Exception exception) {
+ exception.printStackTrace();// NOPMD
+ }
+ }
+}
Copied: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStreamNIO.java (from rev 3083, trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamNIO.java)
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStreamNIO.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStreamNIO.java 2012-05-12 00:19:32 UTC (rev 3085)
@@ -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 java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import net.sf.joafip.file.service.stream.FileOutputStreamNIO;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public class MainWriteRead1GByteFileOutputStreamNIO extends
+ AbstractWriteRead1Gbyte {
+
+ @SuppressWarnings("PMD")
+ public static void main(final String[] args) {
+ try {
+ final File file = new File("runtime/1gb.bin");
+ file.delete();
+ final MainWriteRead1GByteFileOutputStreamNIO main = new MainWriteRead1GByteFileOutputStreamNIO();
+ final OutputStream outputStream = new FileOutputStreamNIO(file);
+ System.out.println("write duration " + main.write(outputStream)
+ + " mS");// NOPMD
+ final InputStream inputStream = new FileInputStream(file);
+ System.out.println("read duration " + main.read(inputStream)
+ + " mS");// NOPMD
+ } catch (Exception exception) {
+ exception.printStackTrace();// NOPMD
+ }
+ }
+}
Added: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/AbstractFileInputStreamOnRandomFile.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/AbstractFileInputStreamOnRandomFile.java (rev 0)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/AbstractFileInputStreamOnRandomFile.java 2012-05-12 00:19:32 UTC (rev 3085)
@@ -0,0 +1,89 @@
+/*
+ * 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.stream;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.file.service.FileIOException;
+import net.sf.joafip.file.service.IRandomAccessFile;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public abstract class AbstractFileInputStreamOnRandomFile extends InputStream {
+
+ private static final int BUFFER_SIZE = 1024 * 128;
+
+ private final byte[] buffer = new byte[BUFFER_SIZE];
+
+ private int bufferSize = 0;
+
+ private int inBufferIndex = 0;
+
+ private final IRandomAccessFile randomAccessFile;
+
+ public AbstractFileInputStreamOnRandomFile(
+ final IRandomAccessFile randomAccessFile) throws IOException {
+ super();
+ this.randomAccessFile = randomAccessFile;
+ try {
+ randomAccessFile.open();
+ } catch (FileIOException exception) {
+ throw new IOException(exception);
+ }
+ }
+
+ @Override
+ public void close() throws IOException {
+ try {
+ randomAccessFile.close();
+ } catch (FileIOException exception) {
+ throw new IOException(exception);
+ }
+ }
+
+ @Override
+ public int read() throws IOException {
+ if (inBufferIndex == bufferSize) {
+ try {
+ bufferSize = randomAccessFile.read(buffer, 0, BUFFER_SIZE);
+ } catch (FileIOException exception) {
+ throw new IOException(exception);
+ }
+ inBufferIndex = 0;
+ }
+ int read;
+ if (bufferSize == -1) {
+ read = -1;
+ } else {
+ read = buffer[inBufferIndex++] & 0xff;
+ }
+ return read;
+ }
+}
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/AbstractFileOutputStreamOnRandomFile.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/AbstractFileOutputStreamOnRandomFile.java 2012-05-11 03:46:15 UTC (rev 3084)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/AbstractFileOutputStreamOnRandomFile.java 2012-05-12 00:19:32 UTC (rev 3085)
@@ -35,7 +35,7 @@
*
*/
@NotStorableClass
-public class AbstractFileOutputStreamOnRandomFile extends OutputStream {
+public abstract class AbstractFileOutputStreamOnRandomFile extends OutputStream {
private static final int BUFFER_SIZE = 1024 * 128;
Added: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/FileInputStreamNIO.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/FileInputStreamNIO.java (rev 0)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/FileInputStreamNIO.java 2012-05-12 00:19:32 UTC (rev 3085)
@@ -0,0 +1,47 @@
+/*
+ * 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.stream;
+
+import java.io.File;
+import java.io.IOException;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.file.service.RandomAccessFileDirectNio;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class FileInputStreamNIO extends AbstractFileInputStreamOnRandomFile {
+
+ public FileInputStreamNIO(final File file) throws IOException {
+ super(new RandomAccessFileDirectNio(file, 1, 0));
+ }
+
+ public FileInputStreamNIO(final String name) throws IOException {
+ this(name == null ? null : new File(name));
+ }
+}
Modified: trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
===================================================================
--- trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java 2012-05-11 03:46:15 UTC (rev 3084)
+++ trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java 2012-05-12 00:19:32 UTC (rev 3085)
@@ -24,10 +24,8 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import net.sf.joafip.btreeplus.service.TestBtreePlusDataManager;
-import net.sf.joafip.btreeplus.service.TestBtreePlusDataManagerBackup;
-import net.sf.joafip.btreeplus.service.TestBtreePlusDataMgrWithKey;
-import net.sf.joafip.btreeplus.service.TestBtreePlusDataMgrWithSce...
[truncated message content] |
|
From: <luc...@us...> - 2012-05-21 01:43:17
|
Revision: 3086
http://joafip.svn.sourceforge.net/joafip/?rev=3086&view=rev
Author: luc_peuvrier
Date: 2012-05-21 01:43:10 +0000 (Mon, 21 May 2012)
Log Message:
-----------
random access file based on mapped byte buffer new implementation
Modified 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/AbstractRandomFileTest.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/AbstractHeapDataManager.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/FileForStorable.java
trunk/joafip-parent/deploy_compiled_tested_by_eclipse.bat
trunk/joafip-parent/install_compiled_tested_by_eclipse.bat
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
Added Paths:
-----------
trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/ByteBufferNode.java
Removed Paths:
-------------
trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/MappedByteBufferNode.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-21 03:59:09
|
Revision: 3087
http://joafip.svn.sourceforge.net/joafip/?rev=3087&view=rev
Author: luc_peuvrier
Date: 2012-05-21 03:59:02 +0000 (Mon, 21 May 2012)
Log Message:
-----------
random access file management refactoring
Modified Paths:
--------------
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/AbstractRandomAccessFile.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/RandomAccessFileDirectNio.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCache.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/RandomAccessFileReadWriteCacheTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileCacheTest.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/FileForStorable.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
Added Paths:
-----------
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/ExRandomAccessFile.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-21 03:59:10
|
Revision: 3087
http://joafip.svn.sourceforge.net/joafip/?rev=3087&view=rev
Author: luc_peuvrier
Date: 2012-05-21 03:59:02 +0000 (Mon, 21 May 2012)
Log Message:
-----------
random access file management refactoring
Modified Paths:
--------------
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/AbstractRandomAccessFile.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/RandomAccessFileDirectNio.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCache.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/RandomAccessFileReadWriteCacheTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileCacheTest.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/FileForStorable.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
Added Paths:
-----------
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/ExRandomAccessFile.java
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-21 01:43:10 UTC (rev 3086)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java 2012-05-21 03:59:02 UTC (rev 3087)
@@ -46,7 +46,7 @@
protected final JoafipLogger logger = JoafipLogger.getLogger(getClass());// NOPMD
- protected static final String RUNTIME_DIR = "runtime_perf";
+ protected static final String RUNTIME_DIR = "runtime_perf"; // "z:\\";//
public static final File DURATION_BIN = new File(RUNTIME_DIR
+ "/duration.bin");
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/AbstractRandomAccessFile.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/AbstractRandomAccessFile.java 2012-05-21 01:43:10 UTC (rev 3086)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/AbstractRandomAccessFile.java 2012-05-21 03:59:02 UTC (rev 3087)
@@ -44,16 +44,6 @@
/** the last closer trace */
private Exception closerTrace;
- protected final int maxRetry;
-
- protected final int retryMsDelay;
-
- public AbstractRandomAccessFile(final int maxRetry, final int retryMsDelay) {
- super();
- this.maxRetry = maxRetry;
- this.retryMsDelay = retryMsDelay;
- }
-
@Override
public void open() throws FileIOException {
checkNotOpened();
Added: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/ExRandomAccessFile.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/ExRandomAccessFile.java (rev 0)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/ExRandomAccessFile.java 2012-05-21 03:59:02 UTC (rev 3087)
@@ -0,0 +1,241 @@
+/*
+ * 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.io.RandomAccessFile;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileLock;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.logger.JoafipLogger;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class ExRandomAccessFile {
+
+ private final static JoafipLogger LOGGER = JoafipLogger
+ .getLogger(ExRandomAccessFile.class);
+
+ private final static HelperFileUtil HELPER_FILE_UTIL = HelperFileUtil
+ .getInstance();
+
+ private static final String WAIT_INTERRUPTED = "wait interrupted. ";
+
+ private static final String M_S = " mS";
+
+ /** read write mode for random file access */
+ private static final String MODE_RWS = "rws";
+
+ /** the file used for random access */
+ private final File file; // NOPMD
+
+ protected final int maxRetry;
+
+ protected final int retryMsDelay;
+
+ /** for random read write file access */
+ private RandomAccessFile randomAccessFile; // NOPMD
+
+ private FileLock fileLock; // NOPMD
+
+ /** the file channel associated with the random read write file */
+ protected FileChannel fileChannel;
+
+ public ExRandomAccessFile(final File file, final int maxRetry,
+ final int retryMsDelay) {
+ super();
+ this.file = file;
+ this.maxRetry = maxRetry;
+ this.retryMsDelay = retryMsDelay;
+ }
+
+ public void open() throws FileIOException {
+ int tryCount = 0;
+ boolean done = false;
+ long startTime = System.currentTimeMillis();
+ while (!done) {
+ final String message = "failed open " + file;
+ try {
+ randomAccessFile = new RandomAccessFile(file, MODE_RWS);// NOPMD
+ done = true;
+ if (tryCount != 0) {
+ LOGGER.warn("succeed open after " + tryCount + " try and "
+ + (System.currentTimeMillis() - startTime) + M_S);
+ }
+ } catch (Exception exception) {
+ if (++tryCount >= maxRetry) {
+ final String failureMessage = message + " try " + tryCount
+ + " time, on "
+ + (System.currentTimeMillis() - startTime) + M_S;
+ LOGGER.fatal(failureMessage);
+ throw HELPER_FILE_UTIL.fileIOException(failureMessage,
+ file, exception);
+ }
+ LOGGER.error("failed open " + file);
+ try {
+ Thread.sleep(retryMsDelay);
+ } catch (InterruptedException exception2) {
+ LOGGER.error(message);
+ throw HELPER_FILE_UTIL.fileIOException(WAIT_INTERRUPTED// NOPMD
+ + message, file, exception);
+ }
+ }
+ }
+
+ tryCount = 0;
+ done = false;
+ startTime = System.currentTimeMillis();
+ while (!done) {
+ try {
+ fileLock = randomAccessFile.getChannel().tryLock();
+ // fileLock = randomAccessFile.getChannel().lock();
+ if (fileLock == null) {
+ throw new IOException("no lock");
+ } else {
+ done = true;
+ if (tryCount != 0) {
+ LOGGER.warn("succeed look after " + tryCount
+ + " try and "
+ + (System.currentTimeMillis() - startTime)
+ + M_S);
+ }
+ }
+ } catch (Exception exception) {
+ final String message = "failed lock " + file;
+ if (++tryCount >= maxRetry) {
+ try {
+ randomAccessFile.close();
+ } catch (Exception exception2) {
+ LOGGER.warn("while closing after acquire lock failure",
+ exception2);
+ }
+ final String failureMessage = message + " try " + tryCount
+ + " time, on "
+ + (System.currentTimeMillis() - startTime) + M_S;
+ LOGGER.fatal(failureMessage, exception);
+ randomAccessFile = null;// NOPMD object no more usable
+ throw HELPER_FILE_UTIL.fileIOException(failureMessage,
+ file, exception);
+ }
+ LOGGER.error(message, exception);
+ try {
+ Thread.sleep(retryMsDelay);
+ } catch (InterruptedException exception2) {
+ LOGGER.error(message, exception2);
+ throw HELPER_FILE_UTIL.fileIOException(WAIT_INTERRUPTED// NOPMD
+ + message, file, exception);
+ }
+ }
+ }
+ fileChannel = randomAccessFile.getChannel();
+ }
+
+ public void close() throws FileIOException {
+ try {
+ if (fileLock != null) {
+ fileLock.release();
+ fileLock = null; // NOPMD release object
+ }
+ fileChannel.close();
+ fileChannel = null; // NOPMD release object
+ randomAccessFile.close();
+ randomAccessFile = null;// NOPMD object no more usable
+ } catch (Exception exception) {
+ throw HELPER_FILE_UTIL.fileIOException("failed close " + file,
+ file, exception);
+ }
+ }
+
+ public void force(final boolean metaData) throws IOException,
+ FileIOException {
+ try {
+ fileChannel.force(metaData);
+ } catch (IOException exception) {
+ throw HELPER_FILE_UTIL.fileIOException("failed force ", file,
+ exception);
+ }
+ }
+
+ public void deleteIfExists() throws FileIOException {
+ if (fileChannel != null) {
+ throw HELPER_FILE_UTIL.fileIOException("failed delete " + file
+ + " because opened", file, null);
+ }
+ HELPER_FILE_UTIL.delete(file, maxRetry, retryMsDelay);
+ Thread.yield();
+ }
+
+ public void deleteIfExistsRenaming() throws FileIOException {
+ if (fileChannel != null) {
+ throw HELPER_FILE_UTIL.fileIOException("failed delete " + file
+ + " because opened", file, null);
+ }
+ HELPER_FILE_UTIL.deleteRenaming(file, maxRetry, retryMsDelay);
+ Thread.yield();
+ }
+
+ public long randomAccessFileLength() throws FileIOException {
+ try {
+ return randomAccessFile.length();
+ } catch (IOException exception) {
+ throw HELPER_FILE_UTIL.fileIOException("failed get length of "
+ + file, file, exception);
+ }
+ }
+
+ public long fileChannelSize() throws FileIOException {
+ try {
+ return fileChannel.size();
+ } catch (IOException exception) {
+ throw HELPER_FILE_UTIL.fileIOException("failed get length of "
+ + file, file, exception);
+ }
+ }
+
+ public File getFile() {
+ return file;
+ }
+
+ public int getMaxRetry() {
+ return maxRetry;
+ }
+
+ public int getRetryMsDelay() {
+ return retryMsDelay;
+ }
+
+ public RandomAccessFile getRandomAccessFile() {
+ return randomAccessFile;
+ }
+
+ public FileChannel getFileChannel() {
+ return fileChannel;
+ }
+}
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirect.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirect.java 2012-05-21 01:43:10 UTC (rev 3086)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirect.java 2012-05-21 03:59:02 UTC (rev 3087)
@@ -22,7 +22,6 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.RandomAccessFile;
-import java.nio.channels.FileLock;
import java.util.SortedMap;
import net.sf.joafip.NotStorableClass;
@@ -38,112 +37,41 @@
private static final String FAILED_OPEN = "failed open ";
- /** read write mode for random file access */
- private static final String MODE_RWS = "rws";
+ private final ExRandomAccessFile exRandomAccessFile;
- /** the file used for random access */
- private final File file; // NOPMD
-
/** current position in file */
private long currentPositionInFile; // NOPMD
- /** for random read write file access */
- private RandomAccessFile randomAccessFile; // NOPMD
+ private RandomAccessFile randomAccessFile;
- private FileLock fileLock; // NOPMD
-
public RandomAccessFileDirect(final File file, final int maxRetry,
final int retryMsDelay) {
- super(maxRetry, retryMsDelay);
- this.file = file;
+ super();
+ this.exRandomAccessFile = new ExRandomAccessFile(file, maxRetry,
+ retryMsDelay);
}
@Override
public File getFile() {
- return file;
+ return exRandomAccessFile.getFile();
}
@Override
public void openImpl() throws FileIOException {
- int tryCount = 0;
- boolean done = false;
- while (!done) {
- try {
- randomAccessFile = new RandomAccessFile(file, MODE_RWS);// NOPMD
- done = true;
- } catch (Exception exception) {
- if (++tryCount >= maxRetry) {
- final String message = FAILED_OPEN + file;
- logger.error(message);
- throw HELPER_FILE_UTIL.fileIOException(message, file,
- exception);
- }
- logger.warn(FAILED_OPEN + file);
- try {
- Thread.sleep(retryMsDelay);
- } catch (InterruptedException exception2) {
- final String message = "wait interrupted, failed open "
- + file;
- logger.error(message);
- throw HELPER_FILE_UTIL.fileIOException(message, file,// NOPMD
- exception);
- }
- }
- }
-
- tryCount = 0;
- done = false;
- while (!done) {
- try {
- fileLock = randomAccessFile.getChannel().tryLock();
- // fileLock = randomAccessFile.getChannel().lock();
- if (fileLock == null) {
- throw new IOException("no lock");
- } else {
- done = true;
- }
- } catch (IOException exception) {
- if (++tryCount >= maxRetry) {
- try {
- randomAccessFile.close();
- } catch (Exception exception2) {
- logger.warn("while closing after acquire lock failure",
- exception2);
- }
- randomAccessFile = null;// NOPMD object no more usable
- throw HELPER_FILE_UTIL.fileIOException("file " + file
- + " failed lock", file, exception);
- }
- try {
- Thread.sleep(retryMsDelay);
- } catch (InterruptedException exception2) {
- final String message = "wait interrupted, file " + file
- + " failed lock";
- logger.error(message, exception2);
- throw HELPER_FILE_UTIL.fileIOException(message, file,// NOPMD
- exception);
- }
- }
- }
-
+ exRandomAccessFile.open();
+ randomAccessFile = exRandomAccessFile.getRandomAccessFile();
currentPositionInFile = 0;
if (logger.debugEnabled) {
- logger.debug("open " + file);
+ logger.debug("open " + getFile());
}
}
@Override
public void closeImpl() throws FileIOException {
- try {
- fileLock.release();
- randomAccessFile.close();
- randomAccessFile = null;// NOPMD object no more usable
- if (logger.debugEnabled) {
- logger.debug("close " + file);
- }
- } catch (Exception exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed close " + file,
- file, exception);
+ randomAccessFile = null;// NOPMD
+ exRandomAccessFile.close();
+ if (logger.debugEnabled) {
+ logger.debug("close " + getFile());
}
}
@@ -155,24 +83,17 @@
@Override
public void deleteIfExistsImpl() throws FileIOException {
- HELPER_FILE_UTIL.delete(file, maxRetry, retryMsDelay);
- Thread.yield();
+ exRandomAccessFile.deleteIfExists();
}
@Override
public void deleteIfExistsRenamingImpl() throws FileIOException {
- HELPER_FILE_UTIL.deleteRenaming(file, maxRetry, retryMsDelay);
- Thread.yield();
+ exRandomAccessFile.deleteIfExistsRenaming();
}
@Override
public long lengthImpl() throws FileIOException {
- try {
- return randomAccessFile.length();
- } catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed get length of "
- + file, file, exception);
- }
+ return exRandomAccessFile.randomAccessFileLength();
}
@Override
@@ -181,8 +102,8 @@
try {
read = randomAccessFile.read(data);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed read " + file, file,
- exception);
+ throw HELPER_FILE_UTIL.fileIOException("failed read " + getFile(),
+ getFile(), exception);
}
if (read > 0) {
currentPositionInFile += read;
@@ -197,8 +118,8 @@
try {
read = randomAccessFile.read(data, offset, length);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed read " + file, file,
- exception);
+ throw HELPER_FILE_UTIL.fileIOException("failed read " + getFile(),
+ getFile(), exception);
}
if (read > 0) {
currentPositionInFile += read;
@@ -212,8 +133,8 @@
try {
randomAccessFile.seek(positionInFile);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException(
- "failed seek in " + file, file, exception);
+ throw HELPER_FILE_UTIL.fileIOException("failed seek in "
+ + getFile(), getFile(), exception);
}
currentPositionInFile = positionInFile;
}
@@ -230,7 +151,7 @@
randomAccessFile.setLength(newSize);
} catch (IOException exception) {
throw HELPER_FILE_UTIL.fileIOException("failed set length of "
- + file, file, exception);
+ + getFile(), getFile(), exception);
}
}
@@ -239,8 +160,8 @@
try {
randomAccessFile.write(data);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed write in " + file,
- file, exception);
+ throw HELPER_FILE_UTIL.fileIOException("failed write in "
+ + getFile(), getFile(), exception);
}
currentPositionInFile += data.length;
}
@@ -251,8 +172,8 @@
try {
randomAccessFile.write(data, 0, length);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed write in " + file,
- file, exception);
+ throw HELPER_FILE_UTIL.fileIOException("failed write in "
+ + getFile(), getFile(), exception);
}
currentPositionInFile += length;
}
@@ -263,8 +184,8 @@
try {
randomAccessFile.write(data, offset, length);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed write in " + file,
- file, exception);
+ throw HELPER_FILE_UTIL.fileIOException("failed write in "
+ + getFile(), getFile(), exception);
}
currentPositionInFile += length;
}
@@ -278,10 +199,10 @@
final FileInputStream fis;
try {
- fis = new FileInputStream(file);
+ fis = new FileInputStream(getFile());
} catch (FileNotFoundException exception) {
- throw HELPER_FILE_UTIL.fileIOException(FAILED_OPEN + file, file,
- exception);
+ throw HELPER_FILE_UTIL.fileIOException(FAILED_OPEN + getFile(),
+ getFile(), exception);
}
final File destinationFile = new File(fileName);
final FileOutputStream fos;
@@ -298,8 +219,8 @@
fos.write(buf, 0, readLength);
}
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed copy from " + file
- + " to " + destinationFile, null, exception);
+ throw HELPER_FILE_UTIL.fileIOException("failed copy from "
+ + getFile() + " to " + destinationFile, null, exception);
} finally {
try {
if (fis != null) {
Modified: 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 2012-05-21 01:43:10 UTC (rev 3086)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped.java 2012-05-21 03:59:02 UTC (rev 3087)
@@ -47,12 +47,12 @@
// private static final String CLOSED = "closed #";
- private static final int MAX_MAP_BITS = 14;// 20bits: 1Mbyte.
+ private static final int MAX_MAP_BITS = 18;// 20bits: 1Mbyte.
// 14 bits: 16 kbytes
private static final int MAX_MAP_SIZE = 1 << MAX_MAP_BITS;
- private static final int MAX_NUMBER_OF_MAP = 32;
+ private static final int MAX_NUMBER_OF_MAP = 128;
private final Map<Long, ByteBufferNode> byteBufferMap =
/**/new TreeMap<Long, ByteBufferNode>();
@@ -77,7 +77,7 @@
fileContentSize = fileChannel.size();
filePhysicalSize = fileContentSize;
} catch (Exception exception) {
- throw new FileIOErrorException("opening file", file, exception);
+ throw new FileIOErrorException("opening file", getFile(), exception);
}
}
@@ -99,7 +99,7 @@
last = null;// NOPMD
fileChannel.truncate(fileContentSize);
} catch (IOException exception) {
- throw new FileIOErrorException("closing file", file, exception);
+ throw new FileIOErrorException("closing file", getFile(), exception);
} finally {
super.closeImpl();
}
@@ -141,7 +141,7 @@
randomAccessFile.setLength(ceilFileSize);
} catch (IOException exception) {
throw HELPER_FILE_UTIL.fileIOException("failed set length of "
- + file, file, exception);
+ + getFile(), getFile(), exception);
}
}
@@ -233,8 +233,8 @@
byteBuffer.position(inMapPosition);
if (byteBuffer.capacity() < toWriteInMap) {
throw new FileIOErrorException("out of capacity "
- + byteBuffer.capacity() + " for " + toWriteInMap, file,
- null);
+ + byteBuffer.capacity() + " for " + toWriteInMap,
+ getFile(), null);
}
byteBuffer.put(data, offset + wrote, toWriteInMap);
wrote += toWriteInMap;
@@ -307,7 +307,7 @@
return fileChannel.map(mode, position, size);
} catch (IOException exception) {
throw new FileIOErrorException("faild map: position=" + position
- + ", size=" + size, file, exception);
+ + ", size=" + size, getFile(), exception);
}
}
@@ -352,7 +352,7 @@
}
throw new FileIOErrorException("unmapping " + byteBuffer.toString()
+ "\nindex #" + index + "\nfile size=" + fileSize + " ("
- + filePhysicalSize + ")", file, exception);
+ + filePhysicalSize + ")", getFile(), exception);
}
}
@@ -367,7 +367,7 @@
filePhysicalSize = endPosition;
}
} catch (Exception exception) {
- throw new FileIOErrorException("writing byte buffer", file,
+ throw new FileIOErrorException("writing byte buffer", getFile(),
exception);
}
}
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectNio.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectNio.java 2012-05-21 01:43:10 UTC (rev 3086)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectNio.java 2012-05-21 03:59:02 UTC (rev 3087)
@@ -23,7 +23,6 @@
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
-import java.nio.channels.FileLock;
import java.util.SortedMap;
import net.sf.joafip.NotStorableClass;
@@ -37,183 +36,70 @@
@NotStorableClass
public class RandomAccessFileDirectNio extends AbstractRandomAccessFile {
- private static final String WAIT_INTERRUPTED = "wait interrupted. ";
+ private final ExRandomAccessFile exRandomAccessFile;
- private static final String M_S = " mS";
-
- /** read write mode for random file access */
- private static final String MODE_RWS = "rws";
-
- /** the file used for random access */
- protected final File file;
-
/** current position in file */
protected long currentPositionInFile;
- /** for random read write file access */
protected RandomAccessFile randomAccessFile;
- /** the file channel associated with the random read write file */
protected FileChannel fileChannel;
- /** lock on the file */
- private FileLock fileLock;
-
public RandomAccessFileDirectNio(final File file, final int maxRetry,
final int retryMsDelay) {
- super(maxRetry, retryMsDelay);
- this.file = file;
+ super();
+ this.exRandomAccessFile = new ExRandomAccessFile(file, maxRetry,
+ retryMsDelay);
}
@Override
public File getFile() {
- return file;
+ return exRandomAccessFile.getFile();
}
@Override
public void openImpl() throws FileIOException {
- int tryCount = 0;
- boolean done = false;
- long startTime = System.currentTimeMillis();
- while (!done) {
- final String message = "failed open " + file;
- try {
- randomAccessFile = new RandomAccessFile(file, MODE_RWS);// NOPMD
- done = true;
- if (tryCount != 0) {
- logger.warn("succeed open after " + tryCount + " try and "
- + (System.currentTimeMillis() - startTime) + M_S);
- }
- } catch (Exception exception) {
- if (++tryCount >= maxRetry) {
- final String failureMessage = message + " try " + tryCount
- + " time, on "
- + (System.currentTimeMillis() - startTime) + M_S;
- logger.fatal(failureMessage);
- throw HELPER_FILE_UTIL.fileIOException(failureMessage,
- file, exception);
- }
- logger.error("failed open " + file);
- try {
- Thread.sleep(retryMsDelay);
- } catch (InterruptedException exception2) {
- logger.error(message);
- throw HELPER_FILE_UTIL.fileIOException(WAIT_INTERRUPTED// NOPMD
- + message, file, exception);
- }
- }
- }
-
- tryCount = 0;
- done = false;
- startTime = System.currentTimeMillis();
- while (!done) {
- try {
- fileLock = randomAccessFile.getChannel().tryLock();
- // fileLock = randomAccessFile.getChannel().lock();
- if (fileLock == null) {
- throw new IOException("no lock");
- } else {
- done = true;
- if (tryCount != 0) {
- logger.warn("succeed look after " + tryCount
- + " try and "
- + (System.currentTimeMillis() - startTime)
- + M_S);
- }
- }
- } catch (Exception exception) {
- final String message = "failed lock " + file;
- if (++tryCount >= maxRetry) {
- try {
- randomAccessFile.close();
- } catch (Exception exception2) {
- logger.warn("while closing after acquire lock failure",
- exception2);
- }
- final String failureMessage = message + " try " + tryCount
- + " time, on "
- + (System.currentTimeMillis() - startTime) + M_S;
- logger.fatal(failureMessage, exception);
- randomAccessFile = null;// NOPMD object no more usable
- throw HELPER_FILE_UTIL.fileIOException(failureMessage,
- file, exception);
- }
- logger.error(message, exception);
- try {
- Thread.sleep(retryMsDelay);
- } catch (InterruptedException exception2) {
- logger.error(message, exception2);
- throw HELPER_FILE_UTIL.fileIOException(WAIT_INTERRUPTED// NOPMD
- + message, file, exception);
- }
- }
- }
+ exRandomAccessFile.open();
+ randomAccessFile = exRandomAccessFile.getRandomAccessFile();
+ fileChannel = exRandomAccessFile.getFileChannel();
currentPositionInFile = 0;
if (logger.debugEnabled) {
- logger.debug("open " + file);
+ logger.debug("open " + getFile());
}
- fileChannel = randomAccessFile.getChannel();
}
@Override
public void closeImpl() throws FileIOException {
- try {
- if (fileLock != null) {
- fileLock.release();
- fileLock = null; // NOPMD release object
- }
- fileChannel.close();
- fileChannel = null; // NOPMD release object
- randomAccessFile.close();
- randomAccessFile = null;// NOPMD object no more usable
- if (logger.debugEnabled) {
- logger.debug("close " + file);
- }
- } catch (Exception exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed close " + file,
- file, exception);
+ fileChannel = null; // NOPMD
+ exRandomAccessFile.close();
+ if (logger.debugEnabled) {
+ logger.debug("close " + getFile());
}
}
@Override
public void flushImpl() throws FileIOException {
try {
- fileChannel.force(true);
+ exRandomAccessFile.force(true);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed flush ", file,
+ throw HELPER_FILE_UTIL.fileIOException("failed flush ", getFile(),
exception);
}
}
@Override
public void deleteIfExistsImpl() throws FileIOException {
- if (fileChannel != null) {
- throw HELPER_FILE_UTIL.fileIOException("failed delete " + file
- + " because opened", file, null);
- }
- HELPER_FILE_UTIL.delete(file, maxRetry, retryMsDelay);
- Thread.yield();
+ exRandomAccessFile.deleteIfExists();
}
@Override
public void deleteIfExistsRenamingImpl() throws FileIOException {
- if (fileChannel != null) {
- throw HELPER_FILE_UTIL.fileIOException("failed delete " + file
- + " because opened", file, null);
- }
- HELPER_FILE_UTIL.deleteRenaming(file, maxRetry, retryMsDelay);
- Thread.yield();
+ exRandomAccessFile.deleteIfExistsRenaming();
}
@Override
public long lengthImpl() throws FileIOException {
- try {
- return fileChannel.size();
- } catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed get length of "
- + file, file, exception);
- }
+ return exRandomAccessFile.fileChannelSize();
}
@Override
@@ -226,8 +112,8 @@
}
return read;
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed read in " + file,
- file, exception);
+ throw HELPER_FILE_UTIL.fileIOException("failed read in "
+ + getFile(), getFile(), exception);
}
}
@@ -242,8 +128,8 @@
}
return read;
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed read in " + file,
- file, exception);
+ throw HELPER_FILE_UTIL.fileIOException("failed read in "
+ + getFile(), getFile(), exception);
}
}
@@ -255,8 +141,8 @@
currentPositionInFile = positionInFile;
}
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed seek in " + file,
- file, exception);
+ throw HELPER_FILE_UTIL.fileIOException("failed seek in "
+ + getFile(), getFile(), exception);
}
}
@@ -271,7 +157,7 @@
randomAccessFile.setLength(newSize);
} catch (IOException exception) {
throw HELPER_FILE_UTIL.fileIOException("failed set length of "
- + file, file, exception);
+ + getFile(), getFile(), exception);
}
}
@@ -281,12 +167,13 @@
final ByteBuffer byteBuffer = ByteBuffer.wrap(data);
if (fileChannel.write(byteBuffer) != data.length) {
throw HELPER_FILE_UTIL.fileIOException("failed write "
- + data.length + " bytes in " + file, file, null);
+ + data.length + " bytes in " + getFile(), getFile(),
+ null);
}
currentPositionInFile += data.length;
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed write in " + file,
- file, exception);
+ throw HELPER_FILE_UTIL.fileIOException("failed write in "
+ + getFile(), getFile(), exception);
}
}
@@ -297,12 +184,12 @@
final ByteBuffer byteBuffer = ByteBuffer.wrap(data, 0, length);
if (fileChannel.writ...
[truncated message content] |
|
From: <luc...@us...> - 2012-05-21 01:43:18
|
Revision: 3086
http://joafip.svn.sourceforge.net/joafip/?rev=3086&view=rev
Author: luc_peuvrier
Date: 2012-05-21 01:43:10 +0000 (Mon, 21 May 2012)
Log Message:
-----------
random access file based on mapped byte buffer new implementation
Modified 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/AbstractRandomFileTest.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/AbstractHeapDataManager.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/FileForStorable.java
trunk/joafip-parent/deploy_compiled_tested_by_eclipse.bat
trunk/joafip-parent/install_compiled_tested_by_eclipse.bat
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
Added Paths:
-----------
trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/ByteBufferNode.java
Removed Paths:
-------------
trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/MappedByteBufferNode.java
Copied: trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/ByteBufferNode.java (from rev 3085, trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/MappedByteBufferNode.java)
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/ByteBufferNode.java (rev 0)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/ByteBufferNode.java 2012-05-21 01:43:10 UTC (rev 3086)
@@ -0,0 +1,111 @@
+/*
+ * 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.entity;
+
+import java.nio.ByteBuffer;
+
+import net.sf.joafip.NotStorableClass;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class ByteBufferNode {
+
+ private final ByteBuffer byteBuffer;
+
+ private final long index;
+
+ private ByteBufferNode previous;
+
+ private ByteBufferNode next;
+
+ private boolean toBeWrote;
+
+ // private Exception closeTrace;
+
+ public ByteBufferNode(final ByteBuffer byteBuffer, final long index) {
+ super();
+ this.byteBuffer = byteBuffer;
+ this.index = index;
+ }
+
+ public ByteBuffer getByteBuffer() {
+ return byteBuffer;
+ }
+
+ public long getIndex() {
+ return index;
+ }
+
+ public ByteBufferNode getPrevious() {
+ return previous;
+ }
+
+ public void setPrevious(final ByteBufferNode previous) {
+ this.previous = previous;
+ }
+
+ public ByteBufferNode getNext() {
+ return next;
+ }
+
+ public void setNext(final ByteBufferNode next) {
+ this.next = next;
+ }
+
+ // public boolean close() {
+ // final boolean wasOpenned = mappedByteBuffer != null;
+ // if (wasOpenned) {
+ // closeTrace = new Exception("closer");// NOPMD
+ // mappedByteBuffer = null;// NOPMD
+ // }
+ // return wasOpenned;
+ // }
+
+ // public Exception getCloseTrace() {
+ // return closeTrace;
+ // }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("MappedByteBufferNode [index=");
+ builder.append(index);
+ // builder.append(", closed=");
+ // builder.append(mappedByteBuffer == null);
+ builder.append("]");
+ return builder.toString();
+ }
+
+ public void setToBeWrote() {
+ toBeWrote = true;
+ }
+
+ public boolean isToBeWrote() {
+ return toBeWrote;
+ }
+}
Deleted: trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/MappedByteBufferNode.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/MappedByteBufferNode.java 2012-05-12 00:19:32 UTC (rev 3085)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/entity/MappedByteBufferNode.java 2012-05-21 01:43:10 UTC (rev 3086)
@@ -1,76 +0,0 @@
-/*
- * 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.entity;
-
-import java.nio.MappedByteBuffer;
-
-import net.sf.joafip.NotStorableClass;
-
-/**
- *
- * @author luc peuvrier
- *
- */
-@NotStorableClass
-public class MappedByteBufferNode {
-
- private final MappedByteBuffer mappedByteBuffer;
-
- private final long index;
-
- private MappedByteBufferNode previous;
-
- private MappedByteBufferNode next;
-
- public MappedByteBufferNode(final MappedByteBuffer mappedByteBuffer,
- final long index) {
- super();
- this.mappedByteBuffer = mappedByteBuffer;
- this.index = index;
- }
-
- public MappedByteBuffer getMappedByteBuffer() {
- return mappedByteBuffer;
- }
-
- public long getIndex() {
- return index;
- }
-
- public MappedByteBufferNode getPrevious() {
- return previous;
- }
-
- public void setPrevious(final MappedByteBufferNode previous) {
- this.previous = previous;
- }
-
- public MappedByteBufferNode getNext() {
- return next;
- }
-
- public void setNext(final MappedByteBufferNode next) {
- this.next = next;
- }
-}
Modified: 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 2012-05-12 00:19:32 UTC (rev 3085)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped.java 2012-05-21 01:43:10 UTC (rev 3086)
@@ -25,6 +25,7 @@
import java.io.File;
import java.io.IOException;
+import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.channels.FileChannel.MapMode;
@@ -32,7 +33,7 @@
import java.util.TreeMap;
import net.sf.joafip.NotStorableClass;
-import net.sf.joafip.file.entity.MappedByteBufferNode;
+import net.sf.joafip.file.entity.ByteBufferNode;
import sun.misc.Cleaner;//NOPMD
/**
@@ -44,22 +45,26 @@
@NotStorableClass
public class RandomAccessFileDirectMapped extends RandomAccessFileDirectNio {
- private static final int MAX_MAP_BITS = 14;// 20bits: 1Mbyte. 14 bits: 16
- // kbytes
+ // private static final String CLOSED = "closed #";
+ private static final int MAX_MAP_BITS = 14;// 20bits: 1Mbyte.
+ // 14 bits: 16 kbytes
+
private static final int MAX_MAP_SIZE = 1 << MAX_MAP_BITS;
- private static final int MAX_NUMBER_OF_MAP = 64;
+ private static final int MAX_NUMBER_OF_MAP = 32;
- private final Map<Long, MappedByteBufferNode> mappedByteBufferMap =
- /**/new TreeMap<Long, MappedByteBufferNode>();
+ private final Map<Long, ByteBufferNode> byteBufferMap =
+ /**/new TreeMap<Long, ByteBufferNode>();
- private MappedByteBufferNode first;
+ private ByteBufferNode first;
- private MappedByteBufferNode last;
+ private ByteBufferNode last;
- private long fileSize;
+ private long fileContentSize;
+ private long filePhysicalSize;
+
public RandomAccessFileDirectMapped(final File file, final int maxRetry,
final int retryMsDelay) {
super(file, maxRetry, retryMsDelay);
@@ -69,7 +74,8 @@
public void openImpl() throws FileIOException {
super.openImpl();
try {
- fileSize = fileChannel.size();
+ fileContentSize = fileChannel.size();
+ filePhysicalSize = fileContentSize;
} catch (Exception exception) {
throw new FileIOErrorException("opening file", file, exception);
}
@@ -78,24 +84,20 @@
@Override
public void closeImpl() throws FileIOException {
try {
- // System.out.println("map");
- // for(MappedByteBufferNode
- // mappedByteBufferNode:mappedByteBufferMap.values()) {
- // System.out.println("unMap "+mappedByteBufferNode.getIndex());
- // // unMap(mappedByteBufferNode.getMappedByteBuffer());
- // }
- // System.out.println("list");
- MappedByteBufferNode current = first;
+ ByteBufferNode current = first;
while (current != null) {
- // System.out.println("unMap "+current.getIndex());
- unMap(current.getMappedByteBuffer());
+ final ByteBuffer byteBuffer = current.getByteBuffer();
+ // if (!current.close()) {
+ // throw new FileIOErrorException(CLOSED + current.getIndex(),
+ // file, current.getCloseTrace());
+ // }
+ unMap(byteBuffer, current.getIndex(), current.isToBeWrote());
current = current.getNext();
}
-
- mappedByteBufferMap.clear();
+ byteBufferMap.clear();
first = null;// NOPMD
last = null;// NOPMD
- randomAccessFile.setLength(fileSize);
+ fileChannel.truncate(fileContentSize);
} catch (IOException exception) {
throw new FileIOErrorException("closing file", file, exception);
} finally {
@@ -110,39 +112,53 @@
@Override
public void flushImpl() throws FileIOException {
- MappedByteBufferNode current = first;
+ ByteBufferNode current = first;
while (current != null) {
- current.getMappedByteBuffer().force();
+ final ByteBuffer byteBuffer = current.getByteBuffer();
+ if (byteBuffer.isDirect()) {
+ ((MappedByteBuffer) byteBuffer).force();
+ } else {
+ final long index = current.getIndex();
+ writeByteBuffer(byteBuffer, index);
+ byteBufferMap.remove(index);
+ remove(current);
+ }
current = current.getNext();
}
}
@Override
public long lengthImpl() throws FileIOException {
- return fileSize;
+ return fileContentSize;
}
@Override
public void setLengthImpl(final long newSize) throws FileIOException {
try {
- unMapIfMapped(newSize);
- fileSize = newSize;
- randomAccessFile.setLength(ceilFileSize(newSize));
+ fileContentSize = newSize;
+ final long ceilFileSize = ceilFileSize(newSize);
+ unMapIfMapped(ceilFileSize);
+ randomAccessFile.setLength(ceilFileSize);
} catch (IOException exception) {
throw HELPER_FILE_UTIL.fileIOException("failed set length of "
+ file, file, exception);
}
}
- private void unMapIfMapped(final long size) {
+ private void unMapIfMapped(final long size) throws FileIOErrorException {
long index = (size >> MAX_MAP_BITS) + 1;
- MappedByteBufferNode mappedByteBufferNode = mappedByteBufferMap
- .remove(index);
- while (mappedByteBufferNode != null) {
- remove(mappedByteBufferNode);
- unMap(mappedByteBufferNode.getMappedByteBuffer());
+ ByteBufferNode byteBufferNode = byteBufferMap.remove(index);
+ while (byteBufferNode != null) {
+ remove(byteBufferNode);
+ final ByteBuffer byteBuffer = byteBufferNode.getByteBuffer();
+ // if (!byteBufferNode.close()) {
+ // throw new FileIOErrorException(CLOSED
+ // + byteBufferNode.getIndex(), file,
+ // byteBufferNode.getCloseTrace());
+ // }
+ unMap(byteBuffer, index, byteBufferNode.isToBeWrote());
index++;
- mappedByteBufferNode = mappedByteBufferMap.remove(index);
+ byteBufferNode = byteBufferMap.remove(index);
}
}
@@ -156,9 +172,9 @@
throws FileIOException {
final int maxReadable;
- if (currentPositionInFile < fileSize) {
- maxReadable = (int) Math.min(fileSize - currentPositionInFile,
- length);
+ if (currentPositionInFile < fileContentSize) {
+ maxReadable = (int) Math.min(fileContentSize
+ - currentPositionInFile, length);
} else {
maxReadable = 0;
}
@@ -175,9 +191,9 @@
} else {
toReadInMap = maxReadable - read;
}
- final MappedByteBuffer mappedByteBuffer = getMappedByteBuffer(index);
- mappedByteBuffer.position(inMapposition);
- mappedByteBuffer.get(data, offset + read, toReadInMap);
+ final ByteBuffer byteBuffer = getMappedByteBuffer(index, false);
+ byteBuffer.position(inMapposition);
+ byteBuffer.get(data, offset + read, toReadInMap);
read += toReadInMap;
index++;
inMapposition = 0;
@@ -203,63 +219,86 @@
long index = currentPositionInFile >> MAX_MAP_BITS;
final long mapStartPosition = ((long) index) << MAX_MAP_BITS;
- int inMapposition = (int) (currentPositionInFile - mapStartPosition);
+ int inMapPosition = (int) (currentPositionInFile - mapStartPosition);
int wrote = 0;
while (wrote != length) {
- final int positionToEndLength = MAX_MAP_SIZE - inMapposition;
+ final int positionToEndLength = MAX_MAP_SIZE - inMapPosition;
final int toWriteInMap;
if (length - wrote > positionToEndLength) {
toWriteInMap = positionToEndLength;
} else {
toWriteInMap = length - wrote;
}
- final MappedByteBuffer mappedByteBuffer = getMappedByteBuffer(index);
- mappedByteBuffer.position(inMapposition);
- if (mappedByteBuffer.capacity() < toWriteInMap) {
+ final ByteBuffer byteBuffer = getMappedByteBuffer(index, true);
+ byteBuffer.position(inMapPosition);
+ if (byteBuffer.capacity() < toWriteInMap) {
throw new FileIOErrorException("out of capacity "
- + mappedByteBuffer.capacity() + " for " + toWriteInMap,
- file, null);
+ + byteBuffer.capacity() + " for " + toWriteInMap, file,
+ null);
}
- if (mappedByteBuffer.limit() < toWriteInMap) {
- // throw new FileIOErrorException("out of limit", file, null);
- mappedByteBuffer.limit(toWriteInMap);
- }
- mappedByteBuffer.put(data, offset + wrote, toWriteInMap);
+ byteBuffer.put(data, offset + wrote, toWriteInMap);
wrote += toWriteInMap;
index++;
- inMapposition = 0;
+ inMapPosition = 0;
}
currentPositionInFile += length;
- if (currentPositionInFile > fileSize) {
- fileSize = currentPositionInFile;
+ if (currentPositionInFile > fileContentSize) {
+ fileContentSize = currentPositionInFile;
}
}
- private MappedByteBuffer getMappedByteBuffer(final long index)
- throws FileIOErrorException {
- final long position = ((long) index) << MAX_MAP_BITS;
- MappedByteBuffer mappedByteBuffer;
- MappedByteBufferNode mappedByteBufferNode = mappedByteBufferMap
- .get(index);
- if (mappedByteBufferNode == null) {
- mappedByteBuffer = fileChannelMap(FileChannel.MapMode.READ_WRITE,
- position, MAX_MAP_SIZE);
- mappedByteBufferNode = new MappedByteBufferNode(mappedByteBuffer,
- index);
- mappedByteBufferMap.put(index, mappedByteBufferNode);
- if (mappedByteBufferMap.size() > MAX_NUMBER_OF_MAP) {
- mappedByteBufferMap.remove(last.getIndex());
- unMap(last.getMappedByteBuffer());
+ private ByteBuffer getMappedByteBuffer(final long index,
+ final boolean forWrite) throws FileIOErrorException {
+ final long positionInFile = index << MAX_MAP_BITS;
+ final ByteBuffer byteBuffer;
+ ByteBufferNode byteBufferNode = byteBufferMap.get(index);
+ if (byteBufferNode == null) {
+ if (positionInFile >= filePhysicalSize) {
+ byteBuffer = ByteBuffer.allocate(MAX_MAP_SIZE);
+ for (int count = 0; count < MAX_MAP_SIZE; count++) {
+ byteBuffer.put((byte) 0);
+ }
+ } else {
+ byteBuffer = fileChannelMap(FileChannel.MapMode.READ_WRITE,
+ positionInFile, MAX_MAP_SIZE);
+ }
+
+ byteBufferNode = new ByteBufferNode(byteBuffer, index);
+ byteBufferMap.put(index, byteBufferNode);
+ add(byteBufferNode);
+ if (byteBufferMap.size() > MAX_NUMBER_OF_MAP) {
+ // ASSERTX
+ final long indexOfLast = last.getIndex();
+ assert index != indexOfLast;
+ final ByteBufferNode removed = byteBufferMap
+ .remove(indexOfLast);
+ // ASSERTX
+ assert removed == last;// NOPMD same instance
remove(last);
+ final ByteBuffer lastMappedByteBuffer = removed.getByteBuffer();
+ // if (!removed.close()) {
+ // throw new FileIOErrorException(CLOSED + removed.getIndex(),
+ // file, removed.getCloseTrace());
+ // }
+ unMap(lastMappedByteBuffer, indexOfLast, removed.isToBeWrote());
}
- add(mappedByteBufferNode);
+
} else {
- mappedByteBuffer = mappedByteBufferNode.getMappedByteBuffer();
- remove(mappedByteBufferNode);
- add(mappedByteBufferNode);
+ // ASSERTX
+ assert byteBufferNode.getIndex() == index;
+ byteBuffer = byteBufferNode.getByteBuffer();
+ // if (byteBuffer == null) {
+ // throw new FileIOErrorException(CLOSED + index, file,
+ // byteBufferNode.getCloseTrace());
+ // }
+ remove(byteBufferNode);
+ add(byteBufferNode);
}
- return mappedByteBuffer;
+ if (forWrite) {
+ byteBufferNode.setToBeWrote();
+ }
+ return byteBuffer;
}
private MappedByteBuffer fileChannelMap(final MapMode mode,
@@ -272,43 +311,82 @@
}
}
- /**
- * 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;
+ final long index = realSize >> MAX_MAP_BITS;
+ return ceilFileSizeForIndex(index);
}
- private void unMap(final MappedByteBuffer mappedByteBuffer) {
- mappedByteBuffer.force();
- final Cleaner cleaner = ((sun.nio.ch.DirectBuffer) mappedByteBuffer)
- .cleaner();
- if (cleaner != null) {
- cleaner.clean();
+ private long ceilFileSizeForIndex(final long index) {
+ return (index + 1) << MAX_MAP_BITS;
+ }
+
+ private void unMap(final ByteBuffer byteBuffer, final long index,
+ final boolean toBeWrote) throws FileIOErrorException {
+ try {
+ if (toBeWrote) {
+ if (byteBuffer.isDirect()) {
+ ((MappedByteBuffer) byteBuffer).force();
+ final Cleaner cleaner = ((sun.nio.ch.DirectBuffer) byteBuffer)
+ .cleaner();
+ if (cleaner != null) {
+ cleaner.clean();
+ }
+ } else {
+ writeByteBuffer(byteBuffer, index);
+ }
+ } else {
+ if (byteBuffer.isDirect()) {
+ final Cleaner cleaner = ((sun.nio.ch.DirectBuffer) byteBuffer)
+ .cleaner();
+ if (cleaner != null) {
+ cleaner.clean();
+ }
+ }
+ }
+ } catch (Exception exception) {
+ String fileSize;
+ try {
+ fileSize = Long.toString(fileChannel.size());
+ } catch (IOException e) {
+ fileSize = "?";
+ }
+ throw new FileIOErrorException("unmapping " + byteBuffer.toString()
+ + "\nindex #" + index + "\nfile size=" + fileSize + " ("
+ + filePhysicalSize + ")", file, exception);
}
}
- private void add(final MappedByteBufferNode mappedByteBufferNode) {
+ private void writeByteBuffer(final ByteBuffer byteBuffer, final long index)
+ throws FileIOErrorException {
+ try {
+ final long positionInFile = index << MAX_MAP_BITS;
+ byteBuffer.clear();
+ fileChannel.write(byteBuffer, positionInFile);
+ final long endPosition = positionInFile + MAX_MAP_SIZE;
+ if (endPosition > filePhysicalSize) {
+ filePhysicalSize = endPosition;
+ }
+ } catch (Exception exception) {
+ throw new FileIOErrorException("writing byte buffer", file,
+ exception);
+ }
+ }
+
+ private void add(final ByteBufferNode byteBufferNode) {
if (first == null) {
- mappedByteBufferNode.setNext(null);
- last = mappedByteBufferNode;
+ byteBufferNode.setNext(null);
+ last = byteBufferNode;
} else {
- first.setPrevious(mappedByteBufferNode);
- mappedByteBufferNode.setNext(first);
+ first.setPrevious(byteBufferNode);
+ byteBufferNode.setNext(first);
}
- mappedByteBufferNode.setPrevious(null);
- first = mappedByteBufferNode;
+ byteBufferNode.setPrevious(null);
+ first = byteBufferNode;
}
- private void remove(final MappedByteBufferNode mappedByteBufferNode) {
- final MappedByteBufferNode previous = mappedByteBufferNode
- .getPrevious();
- final MappedByteBufferNode next = mappedByteBufferNode.getNext();
+ private void remove(final ByteBufferNode byteBufferNode) {
+ final ByteBufferNode previous = byteBufferNode.getPrevious();
+ final ByteBufferNode next = byteBufferNode.getNext();
if (previous == null) {
first = next;
} else {
Modified: trunk/joafip-file/src/test/java/net/sf/joafip/file/service/AbstractRandomFileTest.java
===================================================================
--- trunk/joafip-file/src/test/java/net/sf/joafip/file/service/AbstractRandomFileTest.java 2012-05-12 00:19:32 UTC (rev 3085)
+++ trunk/joafip-file/src/test/java/net/sf/joafip/file/service/AbstractRandomFileTest.java 2012-05-21 01:43:10 UTC (rev 3086)
@@ -1,3 +1,26 @@
+/*
+ * 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;
@@ -11,13 +34,16 @@
import net.sf.joafip.TestConstant;
import net.sf.joafip.TestException;
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
@NotStorableClass
@DoNotTransform
public abstract class AbstractRandomFileTest extends
AbstractJoafipCommonTestCase {
- // private String runtimeFile3;
- //
private String runtimeFile2;
private String runtimeFile1;
@@ -33,7 +59,6 @@
@Override
protected void setUp() throws Exception {// NOPMD
super.setUp();
- // runtimeFile3 = TestConstant.getWinRamDiskRuntimeDir() + "/file3";
runtimeFile2 = TestConstant.getWinRamDiskRuntimeDir() + "/file2";
runtimeFile1 = TestConstant.getWinRamDiskRuntimeDir() + "/file1";
}
@@ -139,28 +164,6 @@
return data;
}
- // public void testCopyDirectOpened() throws IOException, FileIOException
- // {// NOPMD
- // final File file1 = new File(runtimeFile1);
- // file1.delete();
- // final File file2 = new File(runtimeFile2);
- //
- // final IRandomAccessFile randomAccessFileDirect = new
- // RandomAccessFileDirect(
- // file1, 1, 0);
- // copyDiffOpened(file1, file2, randomAccessFileDirect);
- // }
-
- public void testCopyDirectOpened() throws IOException, FileIOException {// NOPMD
- final File file1 = new File(runtimeFile1);
- file1.delete();
- final File file2 = new File(runtimeFile2);
-
- final IRandomAccessFile randomAccessFileDirect = newRandomAccessFile(
- file1, 1, 0);
- copyDiffOpened(file1, file2, randomAccessFileDirect);
- }
-
public void testCopyDirectCacheOpened() throws IOException, FileIOException {// NOPMD
final File file1 = new File(runtimeFile1);
file1.delete();
@@ -190,18 +193,6 @@
assertFalse("files must not differs", fileUtil.diffFile(file1, file2));
}
- // public void testCopyDirectClosed() throws IOException, FileIOException
- // {// NOPMD
- // final File file1 = new File(runtimeFile1);
- // file1.delete();
- // final File file2 = new File(runtimeFile2);
- //
- // final IRandomAccessFile randomAccessFileDirect = new
- // RandomAccessFileDirect(
- // file1, 1, 0);
- // copyDiffClosed(file1, file2, randomAccessFileDirect);
- // }
-
public void testCopyDirectClosed() throws IOException, FileIOException {// NOPMD
final File file1 = new File(runtimeFile1);
file1.delete();
Modified: trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/AbstractHeapDataManager.java
===================================================================
--- trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/AbstractHeapDataManager.java 2012-05-12 00:19:32 UTC (rev 3085)
+++ trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/AbstractHeapDataManager.java 2012-05-21 01:43:10 UTC (rev 3086)
@@ -58,6 +58,72 @@
protected static final String CLEAR_STANDBY_MODIFICATION_FAILED =
/**/"clear standby modification failed";
+ private static final String CLEAR_FAILED =
+ /**/"clear heap failed";
+
+ private static final String DELETE_FAILED =
+ /**/"delete failed";
+
+ private static final String GET_LAST_DATA_RECORD_FAILED =
+ /**/"get last data record failed";
+
+ private static final String GET_FIRST_DATA_RECORD_FAILED =
+ /**/"get first data record failed";
+
+ private static final String HAS_DATA_RECORD_FAILED =
+ /**/"has data record failed";
+
+ private static final String WRITE_FAILED =
+ /**/"write failed";
+
+ private static final String READ_FAILED =
+ /**/"read failed";
+
+ private static final String GET_HEAP_USED_SIZE_FAILED =
+ /**/"get heap used size failed";
+
+ private static final String GET_HEAP_FREE_SIZE_FAILED =
+ /**/"get heap free size failed";
+
+ private static final String GET_HEAP_SIZE_FAILED =
+ /**/"get heap size failed";
+
+ private static final String GET_NUMBER_OF_FREE_RECORD_FAILED =
+ /**/"get number of free record failed";
+
+ private static final String GET_NUMBER_OF_DATA_RECORD_FAILED =
+ /**/"get number of data record failed";
+
+ private static final String REMOVE_FIRST_DATA_RECORD_FAILED =
+ /**/"remove first data record failed";
+
+ private static final String GET_HIGHER_DATA_RECORD_IDENTIFIER_FAILED =
+ /**/"get higher data record identifier failed";
+
+ private static final String GET_CEILING_DATA_RECORD_IDENTIFIER_FAILED =
+ /**/"get ceiling data record identifier failed";
+
+ private static final String GET_FLOOR_DATA_RECORD_IDENTIFIER_FAILED =
+ /**/"get floor data record identifier failed";
+
+ private static final String GET_LOWER_DATA_RECORD_IDENTIFIER_FAILED =
+ /**/"get lower data record identifier failed";
+
+ private static final String GET_NEW_DATA_RECORD_IDENTFIER_FAILED =
+ /**/"get new data record identfier failed";
+
+ private static final String SET_NEXT_FREE_DATA_RECORD_IDENTIFIER_FAILED =
+ /**/"set next free data record identifier failed";
+
+ private static final String GET_NEXT_FREE_DATA_RECORD_IDENTIFIER_FAILED =
+ /**/"get next free data record identifier failed";
+
+ private static final String STOP_SERVICE_FAILED =
+ /**/"stop service failed";
+
+ private static final String START_SERVICE_FAILED =
+ /**/"start service failed";
+
/** true when this is service started state */
private boolean started = false;
@@ -81,9 +147,11 @@
started = true;
starterStackTrace = new Exception("starter stack trace");// NOPMD
} catch (HeapException exception) {
+ logger.fatal(START_SERVICE_FAILED, exception);
closeHeapManagerAfterException();
throw exception;
} catch (RuntimeException exception) {
+ logger.fatal(START_SERVICE_FAILED, exception);
closeHeapManagerAfterException();
throw exception;
}
@@ -114,9 +182,11 @@
stopperStackTrace = new Exception("stopper stack trace");// NOPMD
stopServiceImpl();
} catch (HeapException exception) {
+ logger.fatal(STOP_SERVICE_FAILED, exception);
closeHeapManagerAfterException();
throw exception;
} catch (RuntimeException exception) {
+ logger.fatal(STOP_SERVICE_FAILED, exception);
closeHeapManagerAfterException();
throw exception;
}
@@ -144,10 +214,11 @@
logger.debug("clear");
}
} catch (HeapException exception) {
- logger.fatal(CLEAR_STANDBY_MODIFICATION_FAILED);
+ logger.fatal(CLEAR_FAILED, exception);
closeHeapManagerAfterException();
throw exception;
} catch (RuntimeException exception) {
+ logger.fatal(CLEAR_FAILED, exception);
closeHeapManagerAfterException();
throw exception;
}
@@ -165,10 +236,11 @@
logger.debug("flush");
}
} catch (HeapException exception) {
- logger.fatal(CLEAR_STANDBY_MODIFICATION_FAILED);
+ logger.fatal(FLUSH_FAILED, exception);
closeHeapManagerAfterException();
throw exception;
} catch (RuntimeException exception) {
+ logger.fatal(FLUSH_FAILED, exception);
closeHeapManagerAfterException();
throw exception;
}
@@ -192,10 +264,11 @@
logger.debug("clear standby modification");
}
} catch (HeapException exception) {
- logger.fatal(CLEAR_STANDBY_MODIFICATION_FAILED);
+ logger.fatal(CLEAR_STANDBY_MODIFICATION_FAILED, exception);
closeHeapManagerAfterException();
throw exception;
} catch (RuntimeException exception) {
+ logger.fatal(CLEAR_STANDBY_MODIFICATION_FAILED, exception);
closeHeapManagerAfterException();
throw exception;
}
@@ -211,9 +284,11 @@
assert assertStarted();
return getNextFreeDataRecordIdentifierImpl();
} catch (HeapException exception) {
+ logger.fatal(GET_NEXT_FREE_DATA_RECORD_IDENTIFIER_FAILED, exception);
closeHeapManagerAfterException();
throw exception;
} catch (RuntimeException exception) {
+ logger.fatal(GET_NEXT_FREE_DATA_RECORD_IDENTIFIER_FAILED, exception);
closeHeapManagerAfterException();
throw exception;
}
@@ -231,9 +306,11 @@
assert assertStarted();
setNextFreeDataRecordIdentifierImpl(dataRecordId...
[truncated message content] |
|
From: <luc...@us...> - 2012-05-21 20:59:53
|
Revision: 3088
http://joafip.svn.sourceforge.net/joafip/?rev=3088&view=rev
Author: luc_peuvrier
Date: 2012-05-21 20:59:47 +0000 (Mon, 21 May 2012)
Log Message:
-----------
file io exception refactoring
Modified Paths:
--------------
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/AbstractRandomAccessFile.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/ExRandomAccessFile.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOAccessDenyException.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOErrorException.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOException.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOFailedDeleteException.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOFailedRenameException.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIONotFoundException.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/HelperFileUtil.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/RandomAccessFileDirectNio.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCache.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/ParallelRandomAccessFileForTest.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/service/mock/MockFileForStorable.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-21 20:59:54
|
Revision: 3088
http://joafip.svn.sourceforge.net/joafip/?rev=3088&view=rev
Author: luc_peuvrier
Date: 2012-05-21 20:59:47 +0000 (Mon, 21 May 2012)
Log Message:
-----------
file io exception refactoring
Modified Paths:
--------------
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/AbstractRandomAccessFile.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/ExRandomAccessFile.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOAccessDenyException.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOErrorException.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOException.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOFailedDeleteException.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOFailedRenameException.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIONotFoundException.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/HelperFileUtil.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/RandomAccessFileDirectNio.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCache.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/ParallelRandomAccessFileForTest.java
trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/record/service/mock/MockFileForStorable.java
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/AbstractRandomAccessFile.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/AbstractRandomAccessFile.java 2012-05-21 03:59:02 UTC (rev 3087)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/AbstractRandomAccessFile.java 2012-05-21 20:59:47 UTC (rev 3088)
@@ -190,8 +190,7 @@
if (!opened) {
final File file = getFile();
logger.error(file + " is not opened", closerTrace);
- throw HELPER_FILE_UTIL.fileIOException(file + " is not opened",
- file, null);
+ throw FileIOException.create(file + " is not opened", file, null);
}
}
@@ -199,8 +198,7 @@
if (opened) {
final File file = getFile();
logger.error(file + " is opened", openerTrace);
- throw HELPER_FILE_UTIL.fileIOException(file + " is opened", file,
- null);
+ throw FileIOException.create(file + " is opened", file, null);
}
}
}
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/ExRandomAccessFile.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/ExRandomAccessFile.java 2012-05-21 03:59:02 UTC (rev 3087)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/ExRandomAccessFile.java 2012-05-21 20:59:47 UTC (rev 3088)
@@ -95,15 +95,15 @@
+ " time, on "
+ (System.currentTimeMillis() - startTime) + M_S;
LOGGER.fatal(failureMessage);
- throw HELPER_FILE_UTIL.fileIOException(failureMessage,
- file, exception);
+ throw FileIOException.create(failureMessage, file,
+ exception);
}
LOGGER.error("failed open " + file);
try {
Thread.sleep(retryMsDelay);
} catch (InterruptedException exception2) {
LOGGER.error(message);
- throw HELPER_FILE_UTIL.fileIOException(WAIT_INTERRUPTED// NOPMD
+ throw FileIOException.create(WAIT_INTERRUPTED// NOPMD
+ message, file, exception);
}
}
@@ -141,15 +141,15 @@
+ (System.currentTimeMillis() - startTime) + M_S;
LOGGER.fatal(failureMessage, exception);
randomAccessFile = null;// NOPMD object no more usable
- throw HELPER_FILE_UTIL.fileIOException(failureMessage,
- file, exception);
+ throw FileIOException.create(failureMessage, file,
+ exception);
}
LOGGER.error(message, exception);
try {
Thread.sleep(retryMsDelay);
} catch (InterruptedException exception2) {
LOGGER.error(message, exception2);
- throw HELPER_FILE_UTIL.fileIOException(WAIT_INTERRUPTED// NOPMD
+ throw FileIOException.create(WAIT_INTERRUPTED// NOPMD
+ message, file, exception);
}
}
@@ -168,8 +168,8 @@
randomAccessFile.close();
randomAccessFile = null;// NOPMD object no more usable
} catch (Exception exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed close " + file,
- file, exception);
+ throw FileIOException.create("failed close " + file, file,
+ exception);
}
}
@@ -178,14 +178,13 @@
try {
fileChannel.force(metaData);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed force ", file,
- exception);
+ throw FileIOException.create("failed force ", file, exception);
}
}
public void deleteIfExists() throws FileIOException {
if (fileChannel != null) {
- throw HELPER_FILE_UTIL.fileIOException("failed delete " + file
+ throw FileIOException.create("failed delete " + file
+ " because opened", file, null);
}
HELPER_FILE_UTIL.delete(file, maxRetry, retryMsDelay);
@@ -194,7 +193,7 @@
public void deleteIfExistsRenaming() throws FileIOException {
if (fileChannel != null) {
- throw HELPER_FILE_UTIL.fileIOException("failed delete " + file
+ throw FileIOException.create("failed delete " + file
+ " because opened", file, null);
}
HELPER_FILE_UTIL.deleteRenaming(file, maxRetry, retryMsDelay);
@@ -205,8 +204,8 @@
try {
return randomAccessFile.length();
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed get length of "
- + file, file, exception);
+ throw FileIOException.create("failed get length of " + file, file,
+ exception);
}
}
@@ -214,8 +213,8 @@
try {
return fileChannel.size();
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed get length of "
- + file, file, exception);
+ throw FileIOException.create("failed get length of " + file, file,
+ exception);
}
}
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOAccessDenyException.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOAccessDenyException.java 2012-05-21 03:59:02 UTC (rev 3087)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOAccessDenyException.java 2012-05-21 20:59:47 UTC (rev 3088)
@@ -36,15 +36,14 @@
*/
private static final long serialVersionUID = 273068463040664220L;
- public FileIOAccessDenyException(final String message, final File file,
+ protected FileIOAccessDenyException(final String message, final File file,
final Exception exception) {
- super(message, exception);
- this.file = file;
+ super(message, file, exception);
}
@Override
- public FileIOException create(final String message, final File file,
- final Exception exception) {
+ protected FileIOException newInstance(final String message,
+ final File file, final Exception exception) {
return new FileIOAccessDenyException(message, file, exception);
}
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOErrorException.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOErrorException.java 2012-05-21 03:59:02 UTC (rev 3087)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOErrorException.java 2012-05-21 20:59:47 UTC (rev 3088)
@@ -36,15 +36,14 @@
*/
private static final long serialVersionUID = -6386146407153074823L;
- public FileIOErrorException(final String message, final File file,
+ protected FileIOErrorException(final String message, final File file,
final Exception exception) {
- super(message, exception);
- this.file = file;
+ super(message, file, exception);
}
@Override
- public FileIOException create(final String message, final File file,
- final Exception exception) {
+ protected FileIOException newInstance(final String message,
+ final File file, final Exception exception) {
return new FileIOErrorException(message, file, exception);
}
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOException.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOException.java 2012-05-21 03:59:02 UTC (rev 3087)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOException.java 2012-05-21 20:59:47 UTC (rev 3088)
@@ -23,6 +23,7 @@
package net.sf.joafip.file.service;
import java.io.File;
+import java.io.FileNotFoundException;
/**
*
@@ -36,28 +37,60 @@
*/
private static final long serialVersionUID = -8840281721876126214L;
- protected File file;
+ private final File file;
- protected FileIOException() {
- super();
- }
+ // protected FileIOException() {
+ // super();
+ // }
- protected FileIOException(final String message, final Throwable cause) {
+ protected FileIOException(final String message, final File file,
+ final Throwable cause) {
super(message, cause);
+ this.file = file;
}
- protected FileIOException(final String message) {
- super(message);
- }
+ // protected FileIOException(final String message) {
+ // super(message);
+ // }
- protected FileIOException(final Throwable cause) {
- super(cause);
- }
+ // protected FileIOException(final Throwable cause) {
+ // super(cause);
+ // }
- public abstract FileIOException create(final String message,
+ protected abstract FileIOException newInstance(final String message,
final File file, final Exception exception);
public File getFile() {
return file;
}
+
+ public static FileIOException create(final String message, final File file,
+ final Exception exception) {
+ final FileIOException fileIOException;
+ if (exception == null) {
+ fileIOException = new FileIOErrorException(message, file, exception);
+ } else if (exception instanceof FileNotFoundException) {
+ fileIOException = new FileIONotFoundException(message, file,
+ exception);
+ } else if (exception instanceof SecurityException) {
+ fileIOException = new FileIOAccessDenyException(message, file,
+ exception);
+ } else if (exception instanceof FileIOException) {
+ fileIOException = ((FileIOException) exception).newInstance(
+ message, file, exception);
+ } else {
+ fileIOException = new FileIOErrorException(message, file, exception);
+ }
+ return fileIOException;
+ }
+
+ public static FileIOException createFailedDelete(final String message,
+ final File file, final Exception exception) {
+ return new FileIOFailedDeleteException(message, file, exception);
+ }
+
+ public static FileIOException createFailedRename(final String message,
+ final File file, final Exception exception) {
+ return new FileIOFailedRenameException(message, file, exception);
+ }
}
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOFailedDeleteException.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOFailedDeleteException.java 2012-05-21 03:59:02 UTC (rev 3087)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOFailedDeleteException.java 2012-05-21 20:59:47 UTC (rev 3088)
@@ -36,19 +36,14 @@
*/
private static final long serialVersionUID = 8346085455660939859L;
- public FileIOFailedDeleteException(final String message, final File file,
- final Exception exception) {
- super(message, exception);
- this.file = file;
+ protected FileIOFailedDeleteException(final String message,
+ final File file, final Exception exception) {
+ super(message, file, exception);
}
- public FileIOFailedDeleteException() {
- super();
- }
-
@Override
- public FileIOException create(final String message, final File file,
- final Exception exception) {
+ protected FileIOException newInstance(final String message,
+ final File file, final Exception exception) {
return new FileIOFailedDeleteException(message, file, exception);
}
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOFailedRenameException.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOFailedRenameException.java 2012-05-21 03:59:02 UTC (rev 3087)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIOFailedRenameException.java 2012-05-21 20:59:47 UTC (rev 3088)
@@ -36,19 +36,14 @@
*/
private static final long serialVersionUID = 6556324126404336196L;
- public FileIOFailedRenameException(final String message, final File file,
- final Exception exception) {
- super(message, exception);
- this.file = file;
+ protected FileIOFailedRenameException(final String message,
+ final File file, final Exception exception) {
+ super(message, file, exception);
}
- public FileIOFailedRenameException() {
- super();
- }
-
@Override
- public FileIOException create(final String message, final File file,
- final Exception exception) {
+ protected FileIOException newInstance(final String message,
+ final File file, final Exception exception) {
return new FileIOFailedDeleteException(message, file, exception);
}
}
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIONotFoundException.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIONotFoundException.java 2012-05-21 03:59:02 UTC (rev 3087)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/FileIONotFoundException.java 2012-05-21 20:59:47 UTC (rev 3088)
@@ -36,15 +36,14 @@
*/
private static final long serialVersionUID = 1708501063878637840L;
- public FileIONotFoundException(final String message, final File file,
+ protected FileIONotFoundException(final String message, final File file,
final Exception exception) {
- super(message, exception);
- this.file = file;
+ super(message, file, exception);
}
@Override
- public FileIOException create(final String message, final File file,
- final Exception exception) {
+ protected FileIOException newInstance(final String message,
+ final File file, final Exception exception) {
return new FileIONotFoundException(message, file, exception);
}
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/HelperFileUtil.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/HelperFileUtil.java 2012-05-21 03:59:02 UTC (rev 3087)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/HelperFileUtil.java 2012-05-21 20:59:47 UTC (rev 3088)
@@ -80,7 +80,7 @@
final String message = COPY_FILE_FAILED + sourceFile + " -> "
+ destinationFile;
LOGGER.fatal(message);
- throw fileIOException(message, sourceFile, exception);
+ throw FileIOException.create(message, sourceFile, exception);
}
final FileChannel destinationChannel;
try {
@@ -90,7 +90,7 @@
final String message = COPY_FILE_FAILED + sourceFile + " -> "
+ destinationFile;
LOGGER.fatal(message);
- throw fileIOException(message, destinationFile, exception);
+ throw FileIOException.create(message, destinationFile, exception);
}
try {
destinationChannel.transferFrom(sourceChannel, 0,
@@ -99,7 +99,7 @@
final String message = COPY_FILE_FAILED + sourceFile + " -> "
+ destinationFile;
LOGGER.fatal(message);
- throw fileIOException(message, null, exception);
+ throw FileIOException.create(message, null, exception);
} finally {
if (sourceChannel != null) {
try {
@@ -138,7 +138,8 @@
+ tryCount + TRY_ON
+ (System.currentTimeMillis() - startTime) + M_S;
LOGGER.fatal(failureMessage);
- throw fileIOException(failureMessage, file, exception);
+ throw FileIOException.create(failureMessage, file,
+ exception);
} else {
LOGGER.error(message);
try {
@@ -146,8 +147,11 @@
} catch (InterruptedException exception2) {
LOGGER.error(WAITING_FOR_RETRY_INTERRUPTED
+ FAILED_TOUCH_FILE + file, exception2);
- throw fileIOException(WAITING_FOR_RETRY_INTERRUPTED// NOPMD
- + FAILED_TOUCH_FILE + file, file, exception);
+ throw // NOPMD
+ /**/FileIOException.create(
+ WAITING_FOR_RETRY_INTERRUPTED// NOPMD
+ + FAILED_TOUCH_FILE + file, file,
+ exception);
}
}
}
@@ -171,7 +175,9 @@
+ M_S);
}
} else {
- throw new FileIOFailedDeleteException();
+ throw FileIOException.createFailedDelete(
+ "failed delete try #" + (tryCount + 1), file,
+ null);
}
} catch (Exception exception) {
final String message = FAILED_DELETE_FILE + file;
@@ -181,7 +187,8 @@
+ (System.currentTimeMillis() - startTime)
+ M_S;
LOGGER.fatal(failureMessage, new Exception());// NOPMD
- throw fileIOException(failureMessage, file, exception);
+ throw FileIOException.create(failureMessage, file,
+ exception);
} else {
LOGGER.error(message);
try {
@@ -189,8 +196,10 @@
} catch (InterruptedException exception2) {
LOGGER.error(WAITING_FOR_RETRY_INTERRUPTED
+ FAILED_DELETE_FILE + file, exception2);
- throw fileIOException(WAITING_FOR_RETRY_INTERRUPTED// NOPMD
- + FAILED_DELETE_FILE + file, file,
+ throw // NOPMD
+ /**/FileIOException.createFailedDelete(
+ WAITING_FOR_RETRY_INTERRUPTED
+ + FAILED_DELETE_FILE + file, file,
exception);
}
}
@@ -222,7 +231,9 @@
+ M_S);
}
} else {
- throw new FileIOFailedRenameException();
+ throw FileIOException.createFailedRename(
+ "failed rename try #" + (tryCount + 1), file,
+ null);
}
} catch (Exception exception) {
final String message = FAILED_DELETE_RENAMING_FILE + file;
@@ -232,7 +243,8 @@
+ (System.currentTimeMillis() - startTime)
+ M_S;
LOGGER.fatal(failureMessage);
- throw fileIOException(failureMessage, file, exception);
+ throw FileIOException.create(failureMessage, file,
+ exception);
} else {
LOGGER.error(message);
try {
@@ -241,9 +253,11 @@
LOGGER.error(WAITING_FOR_RETRY_INTERRUPTED
+ FAILED_DELETE_RENAMING_FILE + file,
exception2);
- throw fileIOException(WAITING_FOR_RETRY_INTERRUPTED// NOPMD
- + FAILED_DELETE_RENAMING_FILE + file, file,
- exception);
+ throw // NOPMD
+ /**/FileIOException.create(
+ WAITING_FOR_RETRY_INTERRUPTED// NOPMD
+ + FAILED_DELETE_RENAMING_FILE
+ + file, file, exception);
}
}
}
@@ -276,7 +290,7 @@
} catch (FileNotFoundException exception) {
final String message = FAILED_CHECK_FILE_DIFFERENCE + file1 + COMMA
+ file2;
- throw fileIOException(message, file1, exception);
+ throw FileIOException.create(message, file1, exception);
}
final FileInputStream fis2;
try {
@@ -284,7 +298,7 @@
} catch (FileNotFoundException exception) {
final String message = FAILED_CHECK_FILE_DIFFERENCE + file1 + COMMA
+ file2;
- throw fileIOException(message, file2, exception);
+ throw FileIOException.create(message, file2, exception);
}
int value1;
@@ -295,30 +309,32 @@
try {
value1 = fis1.read();
} catch (IOException exception) {
- throw fileIOException(FAILED_CHECK_FILE_DIFFERENCE + file1
- + COMMA + file2 + ": read " + file1 + FAILED, file1,
- exception);
+ throw FileIOException.create(FAILED_CHECK_FILE_DIFFERENCE
+ + file1 + COMMA + file2 + ": read " + file1 + FAILED,
+ file1, exception);
}
try {
value2 = fis2.read();
} catch (IOException exception) {
- throw fileIOException(FAILED_CHECK_FILE_DIFFERENCE + file1
- + COMMA + file2 + ": read " + file2 + FAILED, file2,
- exception);
+ throw FileIOException.create(FAILED_CHECK_FILE_DIFFERENCE
+ + file1 + COMMA + file2 + ": read " + file2 + FAILED,
+ file2, exception);
}
diff = value1 != value2;
} while (!diff && value1 != -1 && value2 != -1);
try {
fis1.close();
} catch (IOException exception) {
- throw fileIOException(FAILED_CHECK_FILE_DIFFERENCE + file1 + COMMA
- + file2 + ": close " + file1 + FAILED, file1, exception);
+ throw FileIOException.create(FAILED_CHECK_FILE_DIFFERENCE + file1
+ + COMMA + file2 + ": close " + file1 + FAILED, file1,
+ exception);
}
try {
fis2.close();
} catch (IOException exception) {
- throw fileIOException(FAILED_CHECK_FILE_DIFFERENCE + file1 + COMMA
- + file2 + ": close " + file2 + FAILED, file2, exception);
+ throw FileIOException.create(FAILED_CHECK_FILE_DIFFERENCE + file1
+ + COMMA + file2 + ": close " + file2 + FAILED, file2,
+ exception);
}
if (diff) {
LOGGER.warn("difference at position: " + index + " values: "
@@ -326,22 +342,4 @@
}
return diff;
}
-
- public FileIOException fileIOException(final String message,
- final File file, final Exception exception) {
- final FileIOException fileIOException;
- if (exception instanceof FileNotFoundException) {
- fileIOException = new FileIONotFoundException(message, file,
- exception);
- } else if (exception instanceof SecurityException) {
- fileIOException = new FileIOAccessDenyException(message, file,
- exception);
- } else if (exception instanceof FileIOException) {
- fileIOException = ((FileIOException) exception).create(message,
- file, exception);
- } else {
- fileIOException = new FileIOErrorException(message, file, exception);
- }
- return fileIOException;
- }
}
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirect.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirect.java 2012-05-21 03:59:02 UTC (rev 3087)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirect.java 2012-05-21 20:59:47 UTC (rev 3088)
@@ -102,8 +102,8 @@
try {
read = randomAccessFile.read(data);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed read " + getFile(),
- getFile(), exception);
+ throw FileIOException.create("failed read " + getFile(), getFile(),
+ exception);
}
if (read > 0) {
currentPositionInFile += read;
@@ -118,8 +118,8 @@
try {
read = randomAccessFile.read(data, offset, length);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed read " + getFile(),
- getFile(), exception);
+ throw FileIOException.create("failed read " + getFile(), getFile(),
+ exception);
}
if (read > 0) {
currentPositionInFile += read;
@@ -133,8 +133,8 @@
try {
randomAccessFile.seek(positionInFile);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed seek in "
- + getFile(), getFile(), exception);
+ throw FileIOException.create("failed seek in " + getFile(),
+ getFile(), exception);
}
currentPositionInFile = positionInFile;
}
@@ -150,8 +150,8 @@
try {
randomAccessFile.setLength(newSize);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed set length of "
- + getFile(), getFile(), exception);
+ throw FileIOException.create("failed set length of " + getFile(),
+ getFile(), exception);
}
}
@@ -160,8 +160,8 @@
try {
randomAccessFile.write(data);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed write in "
- + getFile(), getFile(), exception);
+ throw FileIOException.create("failed write in " + getFile(),
+ getFile(), exception);
}
currentPositionInFile += data.length;
}
@@ -172,8 +172,8 @@
try {
randomAccessFile.write(data, 0, length);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed write in "
- + getFile(), getFile(), exception);
+ throw FileIOException.create("failed write in " + getFile(),
+ getFile(), exception);
}
currentPositionInFile += length;
}
@@ -184,8 +184,8 @@
try {
randomAccessFile.write(data, offset, length);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed write in "
- + getFile(), getFile(), exception);
+ throw FileIOException.create("failed write in " + getFile(),
+ getFile(), exception);
}
currentPositionInFile += length;
}
@@ -201,16 +201,16 @@
try {
fis = new FileInputStream(getFile());
} catch (FileNotFoundException exception) {
- throw HELPER_FILE_UTIL.fileIOException(FAILED_OPEN + getFile(),
- getFile(), exception);
+ throw FileIOException.create(FAILED_OPEN + getFile(), getFile(),
+ exception);
}
final File destinationFile = new File(fileName);
final FileOutputStream fos;
try {
fos = new FileOutputStream(destinationFile);
} catch (FileNotFoundException exception) {
- throw HELPER_FILE_UTIL.fileIOException(FAILED_OPEN
- + destinationFile, destinationFile, exception);
+ throw FileIOException.create(FAILED_OPEN + destinationFile,
+ destinationFile, exception);
}
try {
final byte[] buf = new byte[1024];
@@ -219,8 +219,8 @@
fos.write(buf, 0, readLength);
}
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed copy from "
- + getFile() + " to " + destinationFile, null, exception);
+ throw FileIOException.create("failed copy from " + getFile()
+ + " to " + destinationFile, null, exception);
} finally {
try {
if (fis != null) {
Modified: 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 2012-05-21 03:59:02 UTC (rev 3087)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectMapped.java 2012-05-21 20:59:47 UTC (rev 3088)
@@ -140,8 +140,8 @@
unMapIfMapped(ceilFileSize);
randomAccessFile.setLength(ceilFileSize);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed set length of "
- + getFile(), getFile(), exception);
+ throw FileIOException.create("failed set length of " + getFile(),
+ getFile(), exception);
}
}
Modified: trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectNio.java
===================================================================
--- trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectNio.java 2012-05-21 03:59:02 UTC (rev 3087)
+++ trunk/joafip-file/src/main/java/net/sf/joafip/file/service/RandomAccessFileDirectNio.java 2012-05-21 20:59:47 UTC (rev 3088)
@@ -82,8 +82,7 @@
try {
exRandomAccessFile.force(true);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed flush ", getFile(),
- exception);
+ throw FileIOException.create("failed flush ", getFile(), exception);
}
}
@@ -112,8 +111,8 @@
}
return read;
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed read in "
- + getFile(), getFile(), exception);
+ throw FileIOException.create("failed read in " + getFile(),
+ getFile(), exception);
}
}
@@ -128,8 +127,8 @@
}
return read;
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed read in "
- + getFile(), getFile(), exception);
+ throw FileIOException.create("failed read in " + getFile(),
+ getFile(), exception);
}
}
@@ -141,8 +140,8 @@
currentPositionInFile = positionInFile;
}
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed seek in "
- + getFile(), getFile(), exception);
+ throw FileIOException.create("failed seek in " + getFile(),
+ getFile(), exception);
}
}
@@ -156,8 +155,8 @@
try {
randomAccessFile.setLength(newSize);
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed set length of "
- + getFile(), getFile(), exception);
+ throw FileIOException.create("failed set length of " + getFile(),
+ getFile(), exception);
}
}
@@ -166,14 +165,13 @@
try {
final ByteBuffer byteBuffer = ByteBuffer.wrap(data);
if (fileChannel.write(byteBuffer) != data.length) {
- throw HELPER_FILE_UTIL.fileIOException("failed write "
- + data.length + " bytes in " + getFile(), getFile(),
- null);
+ throw FileIOException.create("failed write " + data.length
+ + " bytes in " + getFile(), getFile(), null);
}
currentPositionInFile += data.length;
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed write in "
- + getFile(), getFile(), exception);
+ throw FileIOException.create("failed write in " + getFile(),
+ getFile(), exception);
}
}
@@ -183,13 +181,13 @@
try {
final ByteBuffer byteBuffer = ByteBuffer.wrap(data, 0, length);
if (fileChannel.write(byteBuffer) != length) {
- throw HELPER_FILE_UTIL.fileIOException("failed write " + length
+ throw FileIOException.create("failed write " + length
+ " bytes in " + getFile(), getFile(), null);
}
currentPositionInFile += length;
} catch (IOException exception) {
- throw HELPER_FILE_UTIL.fileIOException("failed write in "
- + getFile(), getFile(), exception);
+ throw FileIOException.create("failed write in " + getFile(),
+ getFile(), exception);
}
}
@@ -199,13 +197,13 @@
try {
final ByteBuffer byteBuffer = ByteBuf...
[truncated message content] |
|
From: <luc...@us...> - 2012-05-23 05:25:32
|
Revision: 3090
http://joafip.svn.sourceforge.net/joafip/?rev=3090&view=rev
Author: luc_peuvrier
Date: 2012-05-23 05:25:24 +0000 (Wed, 23 May 2012)
Log Message:
-----------
added buffer parameters for mapped file access
Modified Paths:
--------------
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/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/StoreForTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreNoG.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite3GByteFileOutputStreamMapped.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/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/AbstractRandomAccessFile.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/RandomAccessFileReadWriteCache.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/FileOutputStreamMapped.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/ParallelRandomAccessFileForTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMappedTest.java
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/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/BlockDataManager.java
Added Paths:
-----------
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/FileInputStreamMapped.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/FileAccessParameter.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-23 05:25:34
|
Revision: 3090
http://joafip.svn.sourceforge.net/joafip/?rev=3090&view=rev
Author: luc_peuvrier
Date: 2012-05-23 05:25:24 +0000 (Wed, 23 May 2012)
Log Message:
-----------
added buffer parameters for mapped file access
Modified Paths:
--------------
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/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/StoreForTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreNoG.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite3GByteFileOutputStreamMapped.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/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/AbstractRandomAccessFile.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/RandomAccessFileReadWriteCache.java
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/FileOutputStreamMapped.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/ParallelRandomAccessFileForTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileDirectMappedTest.java
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/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/BlockDataManager.java
Added Paths:
-----------
trunk/joafip-file/src/main/java/net/sf/joafip/file/service/stream/FileInputStreamMapped.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/FileAccessParameter.java
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-21 21:30:06 UTC (rev 3089)
+++ trunk/joafip/src/main/java/net/sf/joafip/entity/FilePersistenceProperties.java 2012-05-23 05:25:24 UTC (rev 3090)
@@ -145,6 +145,14 @@
storeProperties.setFileAccessMode(fileAccessMode);
}
+ public void setMaxNumberOfBuffer(final int maxNumberOfBuffer) {
+ storeProperties.setMaxNumberOfBuffer(maxNumberOfBuffer);
+ }
+
+ public void setMaxBufferSize(final int maxBufferSize) {
+ storeProperties.setMaxBufferSize(maxBufferSize);
+ }
+
public EnumFileAccessMode getFileAccessMode()
throws FilePersistenceException {
try {
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-21 21:30:06 UTC (rev 3089)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistenceBuilder.java 2012-05-23 05:25:24 UTC (rev 3090)
@@ -64,6 +64,20 @@
filePersistenceProperties.setFileAccessMode(fileAccessMode);
}
+ public void setMaxNumberOfBuffer(final int maxNumberOfBuffer) {
+ filePersistenceProperties.setMaxNumberOfBuffer(maxNumberOfBuffer);
+ }
+
+ public void setMaxBufferSize(final int maxBufferSize) {
+ filePersistenceProperties.setMaxBufferSize(maxBufferSize);
+ }
+
+ public void fileBufferSetup(final int maxNumberOfBuffer,
+ final int maxBufferSize) {
+ filePersistenceProperties.setMaxNumberOfBuffer(maxNumberOfBuffer);
+ filePersistenceProperties.setMaxBufferSize(maxBufferSize);
+ }
+
/**
*
* @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-21 21:30:06 UTC (rev 3089)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java 2012-05-23 05:25:24 UTC (rev 3090)
@@ -57,6 +57,10 @@
private static final String JOAFIP_FILE_ACCESS_MODE = "joafip.fileAccessMode";
+ private static final String JOAFIP_NUMBER_OF_FILE_BUFFER = "joafip.numberOfFileBuffer";
+
+ private static final String JOAFIP_FILE_BUFFER_SIZE = "joafip.fileBufferSize";
+
/** storage directory path construction parameter */
private static final String JOAFIP_PATH = "joafip.path";
@@ -192,6 +196,12 @@
+ value + "\",random, nio, or mapped expected");
}
filePersistenceProperties.setFileAccessMode(fileAccessMode);
+ } else if (JOAFIP_NUMBER_OF_FILE_BUFFER.equals(key)) {
+ filePersistenceProperties.setMaxNumberOfBuffer(intValue(
+ key, value));
+ } else if (JOAFIP_FILE_BUFFER_SIZE.equals(key)) {
+ filePersistenceProperties.setMaxBufferSize(intValue(key,
+ value));
} else if (JOAFIP_PATH.equals(key)) {
filePersistenceProperties.setPathName(value);
} else if (JOAFIP_DATA_MODEL_IDENTIFIER.equals(key)) {
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-21 21:30:06 UTC (rev 3089)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/StoreProperties.java 2012-05-23 05:25:24 UTC (rev 3090)
@@ -77,10 +77,36 @@
private EnumFileAccessMode fileAccessMode;
+ private Integer maxNumberOfBuffer;
+
+ private Integer maxBufferSize;
+
public void setFileAccessMode(final EnumFileAccessMode fileAccessMode) {
this.fileAccessMode = fileAccessMode;
}
+ public int getMaxNumberOfBuffer() throws StoreException {
+ if (maxNumberOfBuffer == null) {
+ throw new StoreException("number of file buffer parameter not set");
+ }
+ return maxNumberOfBuffer;
+ }
+
+ public void setMaxNumberOfBuffer(final int maxNumberOfBuffer) {
+ this.maxNumberOfBuffer = maxNumberOfBuffer;
+ }
+
+ public int getMaxBufferSize() throws StoreException {
+ if (maxBufferSize == null) {
+ throw new StoreException("file buffer size parameter not set");
+ }
+ return maxBufferSize;
+ }
+
+ public void setMaxBufferSize(final int maxBufferSize) {
+ this.maxBufferSize = maxBufferSize;
+ }
+
public EnumFileAccessMode getFileAccessMode() throws StoreException {
if (dataManager == null && fileAccessMode == null) {
throw new StoreException("file access mode is not defined");
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-21 21:30:06 UTC (rev 3089)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractDelegatingToStoreManagers.java 2012-05-23 05:25:24 UTC (rev 3090)
@@ -26,7 +26,6 @@
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;
@@ -35,6 +34,7 @@
import net.sf.joafip.service.IFilePersistenceAutoSaver;
import net.sf.joafip.service.JoafipMutex;
import net.sf.joafip.store.entity.StoreHeader;
+import net.sf.joafip.store.entity.StoreProperties;
import net.sf.joafip.store.entity.StoreSynchro;
import net.sf.joafip.store.entity.classinfo.ClassInfo;
import net.sf.joafip.store.entity.classinfo.FieldInfo;
@@ -174,28 +174,14 @@
protected IFilePersistenceAutoSaver saver;
protected AbstractDelegatingToStoreManagers(
- final int currentDataModelIdentifier,
- final InputStreamAndSource dataModelConversionDefInputStream,
- final IHeapDataManager dataManager,
- final EnumFileAccessMode fileAccessMode, final String pathName,
- final String dataFileName, final String backupDataFileName,
- final String stateOkFlagFileName,
- final String stateBackupOkFlagFileName,
- final String globalStateFlagFileName, final boolean crashSafeMode,
- final boolean proxyMode, final boolean useCacheMode,
- final int pageSize, final int maxPage,
- final boolean deleteRenaming, final boolean clearResizeFile,
- final int maxFileOperationRetry,
- final int fileOperationRetryMsDelay, final boolean garbageManagement)
- throws StoreException {
- super(dataManager, fileAccessMode, pathName, dataFileName,
- backupDataFileName, stateOkFlagFileName,
- stateBackupOkFlagFileName, globalStateFlagFileName,
- crashSafeMode, useCacheMode, pageSize, maxPage, deleteRenaming,
- clearResizeFile, maxFileOperationRetry,
- fileOperationRetryMsDelay);
- this.garbageManagement = garbageManagement;
- this.proxyMode = proxyMode;
+ final StoreProperties storeProperties) throws StoreException {
+ super(storeProperties);
+ this.garbageManagement = storeProperties.isGarbageManagement();
+ this.proxyMode = storeProperties.isProxyMode();
+ final int currentDataModelIdentifier = storeProperties
+ .getDataModelIdentifier();
+ final InputStreamAndSource dataModelConversionDefInputStream = storeProperties
+ .getDataModelConversionDefInputStream();
initialize(currentDataModelIdentifier,
dataModelConversionDefInputStream);
}
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-21 21:30:06 UTC (rev 3089)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractStoreDelegatingToDataManager.java 2012-05-23 05:25:24 UTC (rev 3090)
@@ -26,6 +26,7 @@
import net.sf.joafip.kvstore.service.HeapException;
import net.sf.joafip.kvstore.service.IHeapDataManager;
import net.sf.joafip.logger.JoafipLogger;
+import net.sf.joafip.store.entity.StoreProperties;
/**
*
@@ -83,40 +84,55 @@
protected IHeapDataManager dataManager;
protected AbstractStoreDelegatingToDataManager(
- final IHeapDataManager dataManager,
- final EnumFileAccessMode fileAccessMode, final String pathName,
- final String dataFileName, final String backupDataFileName,
- final String stateOkFlagFileName,
- final String stateBackupOkFlagFileName,
- final String globalStateFlagFileName, final boolean crashSafeMode,
- final boolean useCacheMode, final int pageSize, final int maxPage,
- final boolean deleteRenaming, final boolean clearResizeFile,
- final int maxFileOperationRetry, final int fileOperationRetryMsDelay)
- throws StoreException {
+ final StoreProperties storeProperties) throws StoreException {
super();
+
+ final IHeapDataManager dataManager = storeProperties.getDataManager();
if (dataManager == null) {
try {
+ final String dataFileName = storeProperties.getDataFileName();
final String toUseDataFileName = dataFileName == null ? STORE_DATA
: dataFileName;
+ final String pathName = storeProperties.getPathName();
final File dataFile = new File(pathName, toUseDataFileName);
final File openFileTraceFile = new File(pathName, TRACE_FILE);
+ final EnumFileAccessMode fileAccessMode = storeProperties
+ .getFileAccessMode();
+ final boolean crashSafeMode = storeProperties.isCrashSafeMode();
+ final boolean useCacheMode = storeProperties.isUseCacheMode();
+ final boolean deleteRenaming = storeProperties
+ .isDeleteRenaming();
+ final boolean clearResizeFile = storeProperties
+ .isClearResizeFile();
+ final int maxFileOperationRetry = storeProperties
+ .getMaxFileOperationRetry();
+ final int fileOperationRetryMsDelay = storeProperties
+ .getFileOperationRetryMsDelay();
final HeapFileSetup setup = new HeapFileSetup(fileAccessMode,
dataFile, crashSafeMode, useCacheMode, deleteRenaming,
clearResizeFile, maxFileOperationRetry,
fileOperationRetryMsDelay, openFileTraceFile);
if (crashSafeMode) {
+ final String backupDataFileName = storeProperties
+ .getBackupDataFileName();
final String toUseBackupDataFileName = backupDataFileName == null ? STORE_BAK
: backupDataFileName;
final File backupDataFile = new File(pathName,
toUseBackupDataFileName);
+ final String stateOkFlagFileName = storeProperties
+ .getStateOkFlagFileName();
final String toUseStateOkFlagFileName = stateOkFlagFileName == null ? DATA_FLAG
: stateOkFlagFileName;
final File stateOkFlagFile = new File(pathName,
toUseStateOkFlagFileName);
+ final String stateBackupOkFlagFileName = storeProperties
+ .getStateBackupOkFlagFileName();
final String toUseStateBackupOkFlagFileName = stateBackupOkFlagFileName == null ? BACKUP_FLAG
: stateBackupOkFlagFileName;
final File stateBackupOkFlagFile = new File(pathName,
toUseStateBackupOkFlagFileName);
+ final String globalStateFlagFileName = storeProperties
+ .getGlobalStateFlagFileName();
final String toUseGlobalStateFlagFileName = globalStateFlagFileName == null ? GLOBAL_FLAG
: globalStateFlagFileName;
final File globalStateFlagFile = new File(pathName,
@@ -128,8 +144,18 @@
/**/globalStateFlagFile);
}
if (useCacheMode) {
+ final int pageSize = storeProperties.getPageSize();
+ final int maxPage = storeProperties.getMaxPage();
setup.cacheSetup(pageSize, maxPage);
}
+ if (EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS
+ .equals(fileAccessMode)) {
+ final int maxNumberOfBuffer = storeProperties
+ .getMaxNumberOfBuffer();
+ final int maxBufferSize = storeProperties
+ .getMaxBufferSize();
+ setup.fileBufferSetup(maxBufferSize, maxNumberOfBuffer);
+ }
this.dataManager = new HeapFileDataManager(setup, false);
} catch (HeapException exception) {
logger.fatal(CREATION_FAILED, exception);
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-21 21:30:06 UTC (rev 3089)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java 2012-05-23 05:25:24 UTC (rev 3090)
@@ -174,27 +174,7 @@
* @throws StoreException
*/
public Store(final StoreProperties storeProperties) throws StoreException {
- super(
- /**/storeProperties.getDataModelIdentifier(),
- /**/storeProperties.getDataModelConversionDefInputStream(),
- /**/storeProperties.getDataManager(),
- /**/storeProperties.getFileAccessMode(),
- /**/storeProperties.getPathName(),
- /**/storeProperties.getDataFileName(),
- /**/storeProperties.getBackupDataFileName(),
- /**/storeProperties.getStateOkFlagFileName(),
- /**/storeProperties.getStateBackupOkFlagFileName(),
- /**/storeProperties.getGlobalStateFlagFileName(),
- /**/storeProperties.isCrashSafeMode(),
- /**/storeProperties.isProxyMode(),
- /**/storeProperties.isUseCacheMode(),
- /**/storeProperties.getPageSize(),
- /**/storeProperties.getMaxPage(),
- /**/storeProperties.isDeleteRenaming(),
- /**/storeProperties.isClearResizeFile(),
- /**/storeProperties.getMaxFileOperationRetry(),
- /**/storeProperties.getFileOperationRetryMsDelay(),
- /**/storeProperties.isGarbageManagement());
+ super(storeProperties);
setMaintainedInMemoryEnabled(storeProperties.isMaintenedInMemory());
maintainInMemorySetup(storeProperties.getMaintenedInMemoryQuota());
setAutoSaveEnabled(storeProperties.isAutoSaveEnabled());
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-21 21:30:06 UTC (rev 3089)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/ExportStoreQue.java 2012-05-23 05:25:24 UTC (rev 3090)
@@ -62,6 +62,7 @@
1/* maxFileOperationRetry */, 0/* fileOperationRetryMsDelay */,
null/* openFileTraceFile */);
setup.cacheSetup(1024/* pageSize */, 1024/* maxPage */);
+ setup.fileBufferSetup(8 * 1024/* maxBufferSize */, 32/* maxNumberOfBuffer */);
heapDataManagerForSet = new AutoSaveHeapFileDataManager(setup, false,
MAX_RECORDS);
minusOne = longToBinary(-1);
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-21 21:30:06 UTC (rev 3089)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestCustomObjectIO.java 2012-05-23 05:25:24 UTC (rev 3090)
@@ -51,6 +51,8 @@
// /**/false/* do not manage garbage */);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
+ builder.setMaxBufferSize(8 * 1024);
+ builder.setMaxNumberOfBuffer(32);
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-21 21:30:06 UTC (rev 3089)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestSerializable.java 2012-05-23 05:25:24 UTC (rev 3090)
@@ -63,6 +63,8 @@
// /**/false/* do not manage garbage */);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
+ builder.setMaxBufferSize(8 * 1024);
+ builder.setMaxNumberOfBuffer(32);
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-21 21:30:06 UTC (rev 3089)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestBobSerializeStackOverflow.java 2012-05-23 05:25:24 UTC (rev 3090)
@@ -62,6 +62,8 @@
super.setUp();
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
+ builder.setMaxBufferSize(8 * 1024);
+ builder.setMaxNumberOfBuffer(32);
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-21 21:30:06 UTC (rev 3089)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestClear.java 2012-05-23 05:25:24 UTC (rev 3090)
@@ -59,6 +59,8 @@
// /**/false/* do not manage garbage */);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
+ builder.setMaxBufferSize(8 * 1024);
+ builder.setMaxNumberOfBuffer(32);
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-21 21:30:06 UTC (rev 3089)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestCrashSafe.java 2012-05-23 05:25:24 UTC (rev 3090)
@@ -172,6 +172,8 @@
// TestConstant.getRuntimeDir(), false, false);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
+ builder.setMaxBufferSize(8 * 1024);
+ builder.setMaxNumberOfBuffer(32);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
@@ -202,6 +204,8 @@
// TestConstant.getRuntimeDir(), false, false);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
+ builder.setMaxBufferSize(8 * 1024);
+ builder.setMaxNumberOfBuffer(32);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
@@ -228,6 +232,8 @@
// TestConstant.getRuntimeDir(), false, false);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
+ builder.setMaxBufferSize(8 * 1024);
+ builder.setMaxNumberOfBuffer(32);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestExportImport.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestExportImport.java 2012-05-21 21:30:06 UTC (rev 3089)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestExportImport.java 2012-05-23 05:25:24 UTC (rev 3090)
@@ -70,6 +70,8 @@
// TestConstant.getRuntimeDir(), true, false);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
+ builder.setMaxBufferSize(8 * 1024);
+ builder.setMaxNumberOfBuffer(32);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(true);
@@ -166,6 +168,8 @@
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
+ builder.setMaxBufferSize(8 * 1024);
+ builder.setMaxNumberOfBuffer(32);
builder.setProxyMode(true);
builder.setRemoveFiles(true);
builder.setGarbageManagement(false);
@@ -276,6 +280,8 @@
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
+ builder.setMaxBufferSize(8 * 1024);
+ builder.setMaxNumberOfBuffer(32);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemo...
[truncated message content] |
|
From: <luc...@us...> - 2012-05-24 03:41:47
|
Revision: 3091
http://joafip.svn.sourceforge.net/joafip/?rev=3091&view=rev
Author: luc_peuvrier
Date: 2012-05-24 03:41:41 +0000 (Thu, 24 May 2012)
Log Message:
-----------
todo update. tests. clean up.
Modified Paths:
--------------
trunk/joafip/doc/_todo.txt
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java
trunk/joafip-jpa/pom.xml
trunk/joafip-jpa/src/main/java/net/sf/joafip/jpa/JoaFipEntityManager.java
trunk/joafip-jpa/src/main/java/net/sf/joafip/jpa/JoaFipEntityTransaction.java
Added Paths:
-----------
trunk/joafip-jpa/src/main/resources/log4j.properties
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-24 03:41:47
|
Revision: 3091
http://joafip.svn.sourceforge.net/joafip/?rev=3091&view=rev
Author: luc_peuvrier
Date: 2012-05-24 03:41:41 +0000 (Thu, 24 May 2012)
Log Message:
-----------
todo update. tests. clean up.
Modified Paths:
--------------
trunk/joafip/doc/_todo.txt
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java
trunk/joafip-jpa/pom.xml
trunk/joafip-jpa/src/main/java/net/sf/joafip/jpa/JoaFipEntityManager.java
trunk/joafip-jpa/src/main/java/net/sf/joafip/jpa/JoaFipEntityTransaction.java
Added Paths:
-----------
trunk/joafip-jpa/src/main/resources/log4j.properties
Modified: trunk/joafip/doc/_todo.txt
===================================================================
--- trunk/joafip/doc/_todo.txt 2012-05-23 05:25:24 UTC (rev 3090)
+++ trunk/joafip/doc/_todo.txt 2012-05-24 03:41:41 UTC (rev 3091)
@@ -36,7 +36,7 @@
- heap file project make able to create a map in file with a comparable key
- new joafip-pmap project, a file persisted tree map
- heap data manager implemented in btree+ (not use by joafip since HeapFileDataManager speeder)
-- improve speed for file access using mapped byte buffer (+70%)
+- improve speed for file access using mapped byte buffer
minor changes:
- added search last in red black tree manager
@@ -53,7 +53,7 @@
- PLinkedTreeSet and PLinkedHashSet implement List
- setSubstitutionOfJavaUtilCollection can be enabled or disabled, enabled by default
- removeSubstitution added in IFilePersistence
-- new java agent implementation
+- new java agent implementation (performance to be improved)
bugs corrected:
- search in red black tree manager did not return the first element of group of duplicate values
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-23 05:25:24 UTC (rev 3090)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java 2012-05-24 03:41:41 UTC (rev 3091)
@@ -92,7 +92,7 @@
try {
if (dataManager == null) {
builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
- builder.setMaxBufferSize(256 * 1024);
+ builder.setMaxBufferSize(512 * 1024);
builder.setMaxNumberOfBuffer(256);
builder.setPathName(pathName);
if (useCache) {
Modified: trunk/joafip-jpa/pom.xml
===================================================================
--- trunk/joafip-jpa/pom.xml 2012-05-23 05:25:24 UTC (rev 3090)
+++ trunk/joafip-jpa/pom.xml 2012-05-24 03:41:41 UTC (rev 3091)
@@ -7,7 +7,7 @@
<version>1.0.0</version>
<relativePath>../joafip-parent</relativePath>
</parent>
- <groupId>net.sf.joafip</groupId>
+ <!-- <groupId>net.sf.joafip</groupId> -->
<artifactId>joafip-jpa</artifactId>
<packaging>jar</packaging>
<version>4.0.0b8</version>
Modified: trunk/joafip-jpa/src/main/java/net/sf/joafip/jpa/JoaFipEntityManager.java
===================================================================
--- trunk/joafip-jpa/src/main/java/net/sf/joafip/jpa/JoaFipEntityManager.java 2012-05-23 05:25:24 UTC (rev 3090)
+++ trunk/joafip-jpa/src/main/java/net/sf/joafip/jpa/JoaFipEntityManager.java 2012-05-24 03:41:41 UTC (rev 3091)
@@ -24,6 +24,7 @@
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.metamodel.Metamodel;
+import net.sf.joafip.kvstore.entity.EnumFileAccessMode;
import net.sf.joafip.service.FilePersistenceBuilder;
import net.sf.joafip.service.FilePersistenceClassNotFoundException;
import net.sf.joafip.service.FilePersistenceDataCorruptedException;
@@ -63,6 +64,9 @@
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
// builder.setDataModelIdentifier(1);
builder.setPathName(storageDirectory.getPath());
+ builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
+ builder.setMaxBufferSize(8*1024);
+ builder.setMaxNumberOfBuffer(32);
builder.setGarbageManagement(false);
builder.setRemoveFiles(false);
filePersistence = builder.build();
Modified: trunk/joafip-jpa/src/main/java/net/sf/joafip/jpa/JoaFipEntityTransaction.java
===================================================================
--- trunk/joafip-jpa/src/main/java/net/sf/joafip/jpa/JoaFipEntityTransaction.java 2012-05-23 05:25:24 UTC (rev 3090)
+++ trunk/joafip-jpa/src/main/java/net/sf/joafip/jpa/JoaFipEntityTransaction.java 2012-05-24 03:41:41 UTC (rev 3091)
@@ -86,13 +86,11 @@
try {
if (session.isOpened()) {
try {
- session.close(EnumFilePersistenceCloseAction.DO_NOT_SAVE);
+ session.close(EnumFilePersistenceCloseAction.SAVE);
} catch (Exception exception) {// NOPMD
System.err.println("error while saving close " + exception);
}
}
- filePersistence.close(); // ?? jmv
-
} catch (FilePersistenceException e) {
e.printStackTrace();
} finally {
Added: trunk/joafip-jpa/src/main/resources/log4j.properties
===================================================================
--- trunk/joafip-jpa/src/main/resources/log4j.properties (rev 0)
+++ trunk/joafip-jpa/src/main/resources/log4j.properties 2012-05-24 03:41:41 UTC (rev 3091)
@@ -0,0 +1,24 @@
+
+
+log4j.rootLogger=WARN,CONSOLE,FILE
+
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Target=System.out
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+#log4j.appender.CONSOLE.layout.conversionPattern=[%p,%c{1},%t] %m%n
+#log4j.appender.CONSOLE.layout.ConversionPattern=[%5p] - %d [%t] %c (%F:%M:%L) %n %m%n%n
+log4j.appender.CONSOLE.layout.ConversionPattern=[%5p] - %d [%t] (%c.java:%M:%L) %n %m%n%n
+
+log4j.appender.FILE=org.apache.log4j.RollingFileAppender
+#log4j.appender.FILE.File=${webapp.root}/WEB-INF/log4j.log
+log4j.appender.FILE.File=logs/joafip.log
+log4j.appender.FILE.MaxFileSize=1024KB
+log4j.appender.FILE.MaxBackupIndex=3
+log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
+#log4j.appender.FILE.layout.conversionPattern=%d{ABSOLUTE} %5p %c{1},%t:%L - %m%n
+log4j.appender.FILE.layout.ConversionPattern=[%5p] - %d [%t] (%c.java:%M:%L) %n %m%n%n
+
+log4j.logger.net.sf.joafip=warn
+log4j.logger.net.sf.joafip.HelperMemoryUse=info
+log4j.logger.net.sf.joafip.meminspector=warn
+log4j.logger.net.sf.joafip.java.util=warn
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-25 03:44:18
|
Revision: 3093
http://joafip.svn.sourceforge.net/joafip/?rev=3093&view=rev
Author: luc_peuvrier
Date: 2012-05-25 03:44:11 +0000 (Fri, 25 May 2012)
Log Message:
-----------
release maven management change
Modified Paths:
--------------
trunk/joafip/pom.xml
trunk/joafip-4test/pom.xml
trunk/joafip-asm/pom.xml
trunk/joafip-btreeplus/pom.xml
trunk/joafip-callback/pom.xml
trunk/joafip-collection/pom.xml
trunk/joafip-common/pom.xml
trunk/joafip-example-database/pom.xml
trunk/joafip-example-hugemap/pom.xml
trunk/joafip-example-simplestore/pom.xml
trunk/joafip-file/pom.xml
trunk/joafip-heapfile/pom.xml
trunk/joafip-java-agent/pom.xml
trunk/joafip-jpa/pom.xml
trunk/joafip-kvstore/pom.xml
trunk/joafip-log4j/target/joafip-log4j-4.0.0b8-sources.jar
trunk/joafip-log4j/target/joafip-log4j-4.0.0b8-test-sources.jar
trunk/joafip-log4j/target/joafip-log4j-4.0.0b8-tests.jar
trunk/joafip-log4j/target/joafip-log4j-4.0.0b8.jar
trunk/joafip-meminspector/pom.xml
trunk/joafip-parent/pom.xml
trunk/joafip-pmap/pom.xml
trunk/joafip-rbtree/pom.xml
trunk/joafip-testsuite/pom.xml
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-25 03:44:19
|
Revision: 3093
http://joafip.svn.sourceforge.net/joafip/?rev=3093&view=rev
Author: luc_peuvrier
Date: 2012-05-25 03:44:11 +0000 (Fri, 25 May 2012)
Log Message:
-----------
release maven management change
Modified Paths:
--------------
trunk/joafip/pom.xml
trunk/joafip-4test/pom.xml
trunk/joafip-asm/pom.xml
trunk/joafip-btreeplus/pom.xml
trunk/joafip-callback/pom.xml
trunk/joafip-collection/pom.xml
trunk/joafip-common/pom.xml
trunk/joafip-example-database/pom.xml
trunk/joafip-example-hugemap/pom.xml
trunk/joafip-example-simplestore/pom.xml
trunk/joafip-file/pom.xml
trunk/joafip-heapfile/pom.xml
trunk/joafip-java-agent/pom.xml
trunk/joafip-jpa/pom.xml
trunk/joafip-kvstore/pom.xml
trunk/joafip-log4j/target/joafip-log4j-4.0.0b8-sources.jar
trunk/joafip-log4j/target/joafip-log4j-4.0.0b8-test-sources.jar
trunk/joafip-log4j/target/joafip-log4j-4.0.0b8-tests.jar
trunk/joafip-log4j/target/joafip-log4j-4.0.0b8.jar
trunk/joafip-meminspector/pom.xml
trunk/joafip-parent/pom.xml
trunk/joafip-pmap/pom.xml
trunk/joafip-rbtree/pom.xml
trunk/joafip-testsuite/pom.xml
Modified: trunk/joafip/pom.xml
===================================================================
--- trunk/joafip/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -69,6 +69,7 @@
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-rbtree</artifactId>
<version>4.0.0b8</version>
+ <scope>test</scope>
</dependency>
<dependency>
Modified: trunk/joafip-4test/pom.xml
===================================================================
--- trunk/joafip-4test/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip-4test/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -4,13 +4,12 @@
<parent>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-parent</artifactId>
- <version>1.0.0</version>
+ <version>4.0.0b8</version>
<relativePath>../joafip-parent</relativePath>
</parent>
<!-- <groupId>net.sf.joafip</groupId> -->
<artifactId>joafip-4test</artifactId>
<packaging>jar</packaging>
- <version>4.0.0b8</version>
<url>http://joafip.sourceforge.net/</url>
<name>Joafip for test</name>
@@ -22,61 +21,51 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-asm</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-common</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-collection</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-heapfile</artifactId>
- <version>4.0.0b8</version>
</dependency>
<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>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-file</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-callback</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-meminspector</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
@@ -88,7 +77,6 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-log4j</artifactId>
- <version>4.0.0b8</version>
</dependency>
</dependencies>
Modified: trunk/joafip-asm/pom.xml
===================================================================
--- trunk/joafip-asm/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip-asm/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -4,25 +4,19 @@
<parent>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-parent</artifactId>
- <version>1.0.0</version>
+ <version>4.0.0b8</version>
<relativePath>../joafip-parent</relativePath>
</parent>
- <!-- <groupId>net.sf.joafip</groupId> -->
<artifactId>joafip-asm</artifactId>
<packaging>jar</packaging>
- <version>4.0.0b8</version>
<url>http://joafip.sourceforge.net/</url>
<name>Joafip embedded asm</name>
- <!-- <sourceDirectory>src_maven/main/java</sourceDirectory> <testSourceDirectory>src_maven/test/java</testSourceDirectory>
- <resources><resource><directory>src_maven/main/resource</directory></resource></resources> -->
-
<dependencies>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-common</artifactId>
- <version>4.0.0b8</version>
</dependency>
</dependencies>
Modified: trunk/joafip-btreeplus/pom.xml
===================================================================
--- trunk/joafip-btreeplus/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip-btreeplus/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -4,13 +4,12 @@
<parent>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-parent</artifactId>
- <version>1.0.0</version>
+ <version>4.0.0b8</version>
<relativePath>../joafip-parent</relativePath>
</parent>
<!-- <groupId>net.sf.joafip</groupId> -->
<artifactId>joafip-btreeplus</artifactId>
<packaging>jar</packaging>
- <version>4.0.0b8</version>
<url>http://joafip.sourceforge.net/</url>
<name>Joafip storage using btree+</name>
@@ -22,13 +21,11 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-common</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-common</artifactId>
- <version>4.0.0b8</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
@@ -36,13 +33,11 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-kvstore</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-kvstore</artifactId>
- <version>4.0.0b8</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
@@ -50,7 +45,6 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-log4j</artifactId>
- <version>4.0.0b8</version>
<scope>test</scope>
</dependency>
Modified: trunk/joafip-callback/pom.xml
===================================================================
--- trunk/joafip-callback/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip-callback/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -4,13 +4,12 @@
<parent>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-parent</artifactId>
- <version>1.0.0</version>
+ <version>4.0.0b8</version>
<relativePath>../joafip-parent</relativePath>
</parent>
<!-- <groupId>net.sf.joafip</groupId> -->
<artifactId>joafip-callback</artifactId>
<packaging>jar</packaging>
- <version>4.0.0b8</version>
<url>http://joafip.sourceforge.net/</url>
<name>Joafip callback</name>
@@ -22,13 +21,11 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-common</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-log4j</artifactId>
- <version>4.0.0b8</version>
<scope>test</scope>
</dependency>
Modified: trunk/joafip-collection/pom.xml
===================================================================
--- trunk/joafip-collection/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip-collection/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -1,47 +1,42 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-parent</artifactId>
- <version>1.0.0</version>
+ <version>4.0.0b8</version>
<relativePath>../joafip-parent</relativePath>
</parent>
<!-- <groupId>net.sf.joafip</groupId> -->
<artifactId>joafip-collection</artifactId>
<packaging>jar</packaging>
- <version>4.0.0b8</version>
<url>http://joafip.sourceforge.net/</url>
<name>Joafip collection</name>
- <!-- <sourceDirectory>src_maven/main/java</sourceDirectory> <testSourceDirectory>src_maven/test/java</testSourceDirectory>
- <resources><resource><directory>src_maven/main/resource</directory></resource></resources> -->
+ <!-- <sourceDirectory>src_maven/main/java</sourceDirectory> <testSourceDirectory>src_maven/test/java</testSourceDirectory>
+ <resources><resource><directory>src_maven/main/resource</directory></resource></resources> -->
<dependencies>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-common</artifactId>
- <version>4.0.0b8</version>
</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-meminspector</artifactId>
- <version>4.0.0b8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-log4j</artifactId>
- <version>4.0.0b8</version>
<scope>test</scope>
</dependency>
Modified: trunk/joafip-common/pom.xml
===================================================================
--- trunk/joafip-common/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip-common/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -4,13 +4,11 @@
<parent>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-parent</artifactId>
- <version>1.0.0</version>
+ <version>4.0.0b8</version>
<relativePath>../joafip-parent</relativePath>
</parent>
- <!-- <groupId>net.sf.joafip</groupId> -->
<artifactId>joafip-common</artifactId>
<packaging>jar</packaging>
- <version>4.0.0b8</version>
<url>http://joafip.sourceforge.net/</url>
<name>Joafip common</name>
Modified: trunk/joafip-example-database/pom.xml
===================================================================
--- trunk/joafip-example-database/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip-example-database/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -4,13 +4,12 @@
<parent>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-parent</artifactId>
- <version>1.0.0</version>
+ <version>4.0.0b8</version>
<relativePath>../joafip-parent</relativePath>
</parent>
<!-- <groupId>net.sf.joafip</groupId> -->
<artifactId>joafip-example-database</artifactId>
<packaging>jar</packaging>
- <version>4.0.0b8</version>
<url>http://joafip.sourceforge.net/</url>
<name>Joafip database example</name>
@@ -22,13 +21,11 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-log4j</artifactId>
- <version>4.0.0b8</version>
<scope>test</scope>
</dependency>
Modified: trunk/joafip-example-hugemap/pom.xml
===================================================================
--- trunk/joafip-example-hugemap/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip-example-hugemap/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -4,13 +4,12 @@
<parent>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-parent</artifactId>
- <version>1.0.0</version>
+ <version>4.0.0b8</version>
<relativePath>../joafip-parent</relativePath>
</parent>
<!-- <groupId>net.sf.joafip</groupId> -->
<artifactId>joafip-example-hugemap</artifactId>
<packaging>jar</packaging>
- <version>4.0.0b8</version>
<url>http://joafip.sourceforge.net/</url>
<name>Joafip huge map example</name>
@@ -22,19 +21,16 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-meminspector</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-log4j</artifactId>
- <version>4.0.0b8</version>
<scope>test</scope>
</dependency>
Modified: trunk/joafip-example-simplestore/pom.xml
===================================================================
--- trunk/joafip-example-simplestore/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip-example-simplestore/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -4,13 +4,13 @@
<parent>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-parent</artifactId>
- <version>1.0.0</version>
+ <version>4.0.0b8</version>
<relativePath>../joafip-parent</relativePath>
</parent>
<!-- <groupId>net.sf.joafip</groupId> -->
<artifactId>joafip-example-simplestore</artifactId>
<packaging>jar</packaging>
- <version>4.0.0b8</version>
+
<url>http://joafip.sourceforge.net/</url>
<name>Joafip simple store example</name>
@@ -22,13 +22,11 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-log4j</artifactId>
- <version>4.0.0b8</version>
<scope>test</scope>
</dependency>
Modified: trunk/joafip-file/pom.xml
===================================================================
--- trunk/joafip-file/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip-file/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -4,13 +4,11 @@
<parent>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-parent</artifactId>
- <version>1.0.0</version>
+ <version>4.0.0b8</version>
<relativePath>../joafip-parent</relativePath>
</parent>
- <!-- <groupId>net.sf.joafip</groupId> -->
<artifactId>joafip-file</artifactId>
<packaging>jar</packaging>
- <version>4.0.0b8</version>
<url>http://joafip.sourceforge.net/</url>
<name>Joafip file</name>
@@ -22,13 +20,11 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-common</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-common</artifactId>
- <version>4.0.0b8</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
@@ -36,7 +32,6 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-log4j</artifactId>
- <version>4.0.0b8</version>
<scope>test</scope>
</dependency>
Modified: trunk/joafip-heapfile/pom.xml
===================================================================
--- trunk/joafip-heapfile/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip-heapfile/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -4,13 +4,12 @@
<parent>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-parent</artifactId>
- <version>1.0.0</version>
+ <version>4.0.0b8</version>
<relativePath>../joafip-parent</relativePath>
</parent>
<!-- <groupId>net.sf.joafip</groupId> -->
<artifactId>joafip-heapfile</artifactId>
<packaging>jar</packaging>
- <version>4.0.0b8</version>
<url>http://joafip.sourceforge.net/</url>
<name>Joafip heap file</name>
@@ -22,13 +21,11 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-common</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-common</artifactId>
- <version>4.0.0b8</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
@@ -36,56 +33,37 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-kvstore</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-kvstore</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>
- <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-rbtree</artifactId>
- <version>4.0.0b8</version>
- </dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-meminspector</artifactId>
- <version>4.0.0b8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-log4j</artifactId>
- <version>4.0.0b8</version>
<scope>test</scope>
</dependency>
Modified: trunk/joafip-java-agent/pom.xml
===================================================================
--- trunk/joafip-java-agent/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip-java-agent/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -4,13 +4,12 @@
<parent>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-parent</artifactId>
- <version>1.0.0</version>
+ <version>4.0.0b8</version>
<relativePath>../joafip-parent</relativePath>
</parent>
<!-- <groupId>net.sf.joafip</groupId> -->
<artifactId>joafip-java-agent</artifactId>
<packaging>jar</packaging>
- <version>4.0.0b8</version>
<url>http://joafip.sourceforge.net/</url>
<name>Joafip java agent</name>
@@ -22,25 +21,21 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-common</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-callback</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-log4j</artifactId>
- <version>4.0.0b8</version>
<scope>test</scope>
</dependency>
Modified: trunk/joafip-jpa/pom.xml
===================================================================
--- trunk/joafip-jpa/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip-jpa/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -4,13 +4,12 @@
<parent>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-parent</artifactId>
- <version>1.0.0</version>
+ <version>4.0.0b8</version>
<relativePath>../joafip-parent</relativePath>
</parent>
<!-- <groupId>net.sf.joafip</groupId> -->
<artifactId>joafip-jpa</artifactId>
<packaging>jar</packaging>
- <version>4.0.0b8</version>
<url>http://joafip.sourceforge.net/</url>
<name>Joafip / JPA</name>
@@ -19,7 +18,6 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip</artifactId>
- <version>4.0.0b8</version>
</dependency>
<!-- pasted from datanucleus -->
@@ -39,7 +37,6 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-log4j</artifactId>
- <version>4.0.0b8</version>
<scope>test</scope>
</dependency>
Modified: trunk/joafip-kvstore/pom.xml
===================================================================
--- trunk/joafip-kvstore/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip-kvstore/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -4,13 +4,12 @@
<parent>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-parent</artifactId>
- <version>1.0.0</version>
+ <version>4.0.0b8</version>
<relativePath>../joafip-parent</relativePath>
</parent>
<!-- <groupId>net.sf.joafip</groupId> -->
<artifactId>joafip-kvstore</artifactId>
<packaging>jar</packaging>
- <version>4.0.0b8</version>
<url>http://joafip.sourceforge.net/</url>
<name>Joafip key value storage</name>
@@ -22,56 +21,42 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-common</artifactId>
- <version>4.0.0b8</version>
</dependency>
<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>
- <type>test-jar</type>
- <scope>test</scope>
+ <artifactId>joafip-rbtree</artifactId>
</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-rbtree</artifactId>
- <version>4.0.0b8</version>
- </dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-meminspector</artifactId>
- <version>4.0.0b8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-log4j</artifactId>
- <version>4.0.0b8</version>
<scope>test</scope>
</dependency>
Modified: trunk/joafip-log4j/target/joafip-log4j-4.0.0b8-sources.jar
===================================================================
(Binary files differ)
Modified: trunk/joafip-log4j/target/joafip-log4j-4.0.0b8-test-sources.jar
===================================================================
(Binary files differ)
Modified: trunk/joafip-log4j/target/joafip-log4j-4.0.0b8-tests.jar
===================================================================
(Binary files differ)
Modified: trunk/joafip-log4j/target/joafip-log4j-4.0.0b8.jar
===================================================================
(Binary files differ)
Modified: trunk/joafip-meminspector/pom.xml
===================================================================
--- trunk/joafip-meminspector/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip-meminspector/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -4,13 +4,12 @@
<parent>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-parent</artifactId>
- <version>1.0.0</version>
+ <version>4.0.0b8</version>
<relativePath>../joafip-parent</relativePath>
</parent>
<!-- <groupId>net.sf.joafip</groupId> -->
<artifactId>joafip-meminspector</artifactId>
<packaging>jar</packaging>
- <version>4.0.0b8</version>
<url>http://joafip.sourceforge.net/</url>
<name>Joafip memory inspector</name>
@@ -22,13 +21,11 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-common</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-file</artifactId>
- <version>4.0.0b8</version>
</dependency>
<dependency>
@@ -40,7 +37,6 @@
<dependency>
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-log4j</artifactId>
- <version>4.0.0b8</version>
<scope>test</scope>
</dependency>
Modified: trunk/joafip-parent/pom.xml
===================================================================
--- trunk/joafip-parent/pom.xml 2012-05-24 04:28:02 UTC (rev 3092)
+++ trunk/joafip-parent/pom.xml 2012-05-25 03:44:11 UTC (rev 3093)
@@ -1,10 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
+
<groupId>net.sf.joafip</groupId>
<artifactId>joafip-parent</artifactId>
- <version>1.0.0</version>
- <packaging>pom</packaging>
+ <version>4.0.0b8</version>
+ <packaging>pom</packaging>
<name>JOAFIP "Abstract" Parent Project</name>
<description>The project provides object persistence in file
</description>
@@ -14,7 +15,10 @@
to copy filtered resources, i.e. build is platform dependent! -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <joafip.version>4.0.0b8</joafip.version>
+
</properties>
+
<profiles>
<profile>
@@ -327,8 +331,181 @@
</build>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-example-simplestore</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-example-simplestore</artifactId>
+ <version>${joafip.version}</version>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-example-hugemap</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-example-database</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip</artifactId>
+ <version>${joafip.version}</version>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-asm</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-common</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-common</artifactId>
+ <type>test-jar</type>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-file</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-file</artifactId>
+ <version>${joafip.version}</version>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-rbtree</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-rbtree</artifactId>
+ <version>${joafip.version}</version>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-collection</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-collection</artifactId>
+ <version>${joafip.version}</version>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-kvstore</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-kvstore</artifactId>
+ <version>${joafip.version}</version>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-heapfile</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-heapfile</artifactId>
+ <version>${joafip.version}</version>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-btreeplus</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-btreeplus</artifactId>
+ <version>${joafip.version}</version>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-pmap</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-pmap</artifactId>
+ <version>${joafip.version}</version>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-callback</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-java-agent</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-meminspector</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-meminspector</artifactId>
+ <version>${joafip.version}</version>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-jpa</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-log4j</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-testsuite</artifactId>
+ <version>${joafip.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-4test</artifactId>
+ <version>${joafip.version}</...
[truncated message content] |
|
From: <luc...@us...> - 2012-05-26 10:24:40
|
Revision: 3096
http://joafip.svn.sourceforge.net/joafip/?rev=3096&view=rev
Author: luc_peuvrier
Date: 2012-05-26 10:24:33 +0000 (Sat, 26 May 2012)
Log Message:
-----------
heap file data manager accept empty data storage
Modified Paths:
--------------
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusElementMgr.java
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/HeapRecord.java
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.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/BlockDataManager.java
trunk/joafip-meminspector/src/main/java/net/sf/joafip/meminspector/service/show/NodeForObjectTreeCellRenderer.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
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-26 09:02:56 UTC (rev 3095)
+++ trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusElementMgr.java 2012-05-26 10:24:33 UTC (rev 3096)
@@ -144,12 +144,10 @@
}
public long freeSize() throws HeapException {
- // FIXMELUC ____btree+ to implement
throw new HeapException("not implemented");
}
public long usedSize() throws HeapException {
- // FIXMELUC ____btree+ to implement
throw new HeapException("not implemented");
}
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-26 09:02:56 UTC (rev 3095)
+++ trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/HeapRecord.java 2012-05-26 10:24:33 UTC (rev 3096)
@@ -378,7 +378,7 @@
}
private void assertDataRecordStateForMarshalling() throws HeapException {
- if ((dataAssociatedSize == null || dataAssociatedSize <= 0)) {
+ if ((dataAssociatedSize == null /* || dataAssociatedSize <= 0 */)) {
logger.fatal(ASSOCIATED_DATA_SIZE_MUST_BE_DEFINED
+ " data record identifier=" + nodeIdentifier);
throw new HeapException(ASSOCIATED_DATA_SIZE_MUST_BE_DEFINED);
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-26 09:02:56 UTC (rev 3095)
+++ trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java 2012-05-26 10:24:33 UTC (rev 3096)
@@ -55,8 +55,6 @@
public class HeapFileDataManager extends AbstractHeapDataManager implements
IHeapRecordFactory {// NOPMD
- // FIXMELUC ______HeapFileDataManager not accept empty data
-
private static final String IDENTIFIER2 = ", identifier=";
/**
Modified: trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestHeapDataManagerImpl.java
===================================================================
--- trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestHeapDataManagerImpl.java 2012-05-26 09:02:56 UTC (rev 3095)
+++ trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/AbstractTestHeapDataManagerImpl.java 2012-05-26 10:24:33 UTC (rev 3096)
@@ -629,4 +629,16 @@
assertNull(MUST_NOT_HAVE_DATA_RECORD,
heapDataManager.removeFirstDataRecord());
}
+
+ public void testEmptyData() throws HeapException {
+ createHeap(true);
+ final DataRecordIdentifier identifier = heapDataManager
+ .getNewDataRecordIdentifier();
+ final byte[] data = new byte[0];
+ heapDataManager.writeDataRecord(identifier, data);
+ heapDataManager.flush();
+ final byte[] readData = heapDataManager.readDataRecord(identifier);
+ assertNotNull("must read", readData);
+ assertEquals(BAD_VALUE, 0, readData.length);
+ }
}
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-26 09:02:56 UTC (rev 3095)
+++ trunk/joafip-kvstore/src/test/java/net/sf/joafip/kvstore/service/BlockDataManager.java 2012-05-26 10:24:33 UTC (rev 3096)
@@ -62,6 +62,9 @@
public BlockDataManager(final String filePath, final int blockLength)
throws HeapException {
super();
+ if (blockLength >= 0xffff) {
+ throw new HeapException("too big block length");
+ }
final File file = new File(filePath);
randomAccessFile = new RandomAccessFileDirectNio(file, 0, 0);
// randomAccessFile = new RandomAccessFileDirect(file, 0, 0);
@@ -204,13 +207,13 @@
if (read == 2) {
final int length = (((int) lengthData[0]) & 0xff) << 8
| (((int) lengthData[1]) & 0xff);
- if (length == 0) {
+ if (length == 0xffff) {
deleted = false;
} else {
header.decrementNumberOfDataRecord();
deleted = true;
- lengthData[0] = (byte) 0;
- lengthData[1] = (byte) 0;
+ lengthData[0] = (byte) 0xff;
+ lengthData[1] = (byte) 0xff;
write(position, 0, lengthData);
}
} else {
@@ -234,7 +237,7 @@
final int length = (((int) data[0]) & 0xff) << 8
| (((int) data[1]) & 0xff);
- if (length == 0) {
+ if (length == 0xffff) {
data = null;// NOPMD
} else {
data = new byte[length];
@@ -253,9 +256,9 @@
protected boolean writeDataRecordImpl(
final DataRecordIdentifier dataRecordIdentifier, final byte[] data)
throws HeapException {
- if (data.length == 0) {
- throw new HeapException("no data");
- }
+ // if (data.length == 0) {
+ // throw new HeapException("no data");
+ // }
if (data.length > header.getBlockLength() - 2) {
throw new HeapException("too big data: " + data.length
+ " for block of " + header.getBlockLength());
@@ -269,7 +272,7 @@
if (read == 2) {
previousLength = (((int) lengthData[0]) & 0xff) << 8
| (((int) lengthData[1]) & 0xff);
- created = previousLength == 0;
+ created = previousLength == 0xffff;
} else {
created = true;
}
@@ -300,7 +303,7 @@
if (read == 2) {
final int length = (((int) lengthData[0]) & 0xff) << 8
| (((int) lengthData[1]) & 0xff);
- hasDatarecord = length != 0;
+ hasDatarecord = length != 0xffff;
} else {
hasDatarecord = false;
}
Modified: trunk/joafip-meminspector/src/main/java/net/sf/joafip/meminspector/service/show/NodeForObjectTreeCellRenderer.java
===================================================================
--- trunk/joafip-meminspector/src/main/java/net/sf/joafip/meminspector/service/show/NodeForObjectTreeCellRenderer.java 2012-05-26 09:02:56 UTC (rev 3095)
+++ trunk/joafip-meminspector/src/main/java/net/sf/joafip/meminspector/service/show/NodeForObjectTreeCellRenderer.java 2012-05-26 10:24:33 UTC (rev 3096)
@@ -182,7 +182,6 @@
+ (int) rectangle.getWidth(), Math.max(iconHeight,
(int) rectangle.getHeight()));
// setPreferredSize(dimension);
- // FIXMELUC x this is a hack
setPreferredSize(new Dimension(2048, dimension.height));
} catch (Exception exception) {
LOGGER.error("error", exception);
Modified: trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
===================================================================
--- trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java 2012-05-26 09:02:56 UTC (rev 3095)
+++ trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java 2012-05-26 10:24:33 UTC (rev 3096)
@@ -24,10 +24,8 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import net.sf.joafip.file.service.RandomFileCacheTest;
-import net.sf.joafip.file.service.RandomFileDirectMappedTest;
-import net.sf.joafip.file.service.RandomFileDirectNioTest;
-import net.sf.joafip.file.service.RandomFileDirectTest;
+import net.sf.joafip.heapfile.service.TestHeapFileDataManager;
+import net.sf.joafip.kvstore.service.TestBlockDataManager;
/**
*
@@ -44,10 +42,8 @@
public static Test suite() {
final TestSuite suite = new TestSuite("in error Tests");
// $JUnit-BEGIN$
- suite.addTestSuite(RandomFileDirectTest.class);
- suite.addTestSuite(RandomFileDirectNioTest.class);
- suite.addTestSuite(RandomFileCacheTest.class);
- suite.addTestSuite(RandomFileDirectMappedTest.class);
+ suite.addTestSuite(TestBlockDataManager.class);
+ suite.addTestSuite(TestHeapFileDataManager.class);
// suite.addTest(xxxx.suite());
// $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-26 10:24:40
|
Revision: 3096
http://joafip.svn.sourceforge.net/joafip/?rev=3096&view=rev
Author: luc_peuvrier
Date: 2012-05-26 10:24:33 +0000 (Sat, 26 May 2012)
Log Message:
-----------
heap file data manager accept empty data storage
Modified Paths:
--------------
trunk/joafip-btreeplus/src/main/java/net/sf/joafip/btreeplus/service/BtreePlusElementMgr.java
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/record/entity/HeapRecord.java
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.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/BlockDataManager.java
trunk/joafip-meminspector/src/main/java/net/sf/joafip/meminspector/service/show/NodeForObjectTreeCellRenderer.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-26 11:16:20
|
Revision: 3097
http://joafip.svn.sourceforge.net/joafip/?rev=3097&view=rev
Author: luc_peuvrier
Date: 2012-05-26 11:16:14 +0000 (Sat, 26 May 2012)
Log Message:
-----------
tree sub set remove and contains correction
Modified Paths:
--------------
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PTreeSubSet.java
trunk/joafip-collection/src/test/java/net/sf/joafip/java/util/AbstractTestSubPTreeSet.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
Modified: trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PTreeSubSet.java
===================================================================
--- trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PTreeSubSet.java 2012-05-26 10:24:33 UTC (rev 3096)
+++ trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PTreeSubSet.java 2012-05-26 11:16:14 UTC (rev 3097)
@@ -139,16 +139,30 @@
return super.add(element);
}
- // FIXMELUC ____must be override
+ @SuppressWarnings("unchecked")
@Override
public boolean contains(final Object object) {// NOPMD
- return super.contains(object);
+ final boolean contains;
+ final E element = (E) object;
+ if (!beforeTo(element) || !afterFrom(element)) {// NOPMD
+ contains = false;
+ } else {
+ contains = super.contains(object);
+ }
+ return contains;
}
- // FIXMELUC ____must be override
+ @SuppressWarnings("unchecked")
@Override
public boolean remove(final Object object) {// NOPMD
- return super.remove(object);
+ final boolean remove;
+ final E element = (E) object;
+ if (!beforeTo(element) || !afterFrom(element)) {// NOPMD
+ remove = false;
+ } else {
+ remove = super.remove(object);
+ }
+ return remove;
}
@Override
Modified: trunk/joafip-collection/src/test/java/net/sf/joafip/java/util/AbstractTestSubPTreeSet.java
===================================================================
--- trunk/joafip-collection/src/test/java/net/sf/joafip/java/util/AbstractTestSubPTreeSet.java 2012-05-26 10:24:33 UTC (rev 3096)
+++ trunk/joafip-collection/src/test/java/net/sf/joafip/java/util/AbstractTestSubPTreeSet.java 2012-05-26 11:16:14 UTC (rev 3097)
@@ -59,4 +59,14 @@
protected boolean acceptNullElement() { // NOPMD
return true;
}
+
+ public void testContains() {
+ assertFalse("must not containes '0'", set.contains("0"));
+ assertFalse("must not containes '{'", set.contains("{"));
+ }
+
+ public void testRemove() {
+ assertFalse("must not containes '0'", set.remove("0"));
+ assertFalse("must not containes '{'", set.remove("{"));
+ }
}
Modified: trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
===================================================================
--- trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java 2012-05-26 10:24:33 UTC (rev 3096)
+++ trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java 2012-05-26 11:16:14 UTC (rev 3097)
@@ -24,8 +24,8 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import net.sf.joafip.heapfile.service.TestHeapFileDataManager;
-import net.sf.joafip.kvstore.service.TestBlockDataManager;
+import net.sf.joafip.java.util.TestSubPTreeSetConcurrent;
+import net.sf.joafip.java.util.TestSubPTreeSetNoConcurrent;
/**
*
@@ -42,8 +42,8 @@
public static Test suite() {
final TestSuite suite = new TestSuite("in error Tests");
// $JUnit-BEGIN$
- suite.addTestSuite(TestBlockDataManager.class);
- suite.addTestSuite(TestHeapFileDataManager.class);
+ suite.addTestSuite(TestSubPTreeSetConcurrent.class);
+ suite.addTestSuite(TestSubPTreeSetNoConcurrent.class);
// suite.addTest(xxxx.suite());
// $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-26 11:16:21
|
Revision: 3097
http://joafip.svn.sourceforge.net/joafip/?rev=3097&view=rev
Author: luc_peuvrier
Date: 2012-05-26 11:16:14 +0000 (Sat, 26 May 2012)
Log Message:
-----------
tree sub set remove and contains correction
Modified Paths:
--------------
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PTreeSubSet.java
trunk/joafip-collection/src/test/java/net/sf/joafip/java/util/AbstractTestSubPTreeSet.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-27 05:07:43
|
Revision: 3100
http://joafip.svn.sourceforge.net/joafip/?rev=3100&view=rev
Author: luc_peuvrier
Date: 2012-05-27 05:07:36 +0000 (Sun, 27 May 2012)
Log Message:
-----------
can setup the prohibited package by security manager, this information is used by proxy class generator
Modified Paths:
--------------
trunk/joafip/doc/_todo.txt
trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/FieldInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/AbstractClassCreator.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/forimport/ClassCreator.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassEnhancer.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/EnhanceCodeGenerator.java
trunk/joafip/src/test/java/net/sf/joafip/service/sync/TestSynchronizedCollection.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreWithBobFileLazy.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/BobPackageVisibility.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyInterceptPackageVisibility.java
trunk/joafip/src/test/resources/log4j.properties
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
Added Paths:
-----------
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/PackageInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/SunPackage.java
Removed Paths:
-------------
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/SunPackage.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-27 05:07:44
|
Revision: 3100
http://joafip.svn.sourceforge.net/joafip/?rev=3100&view=rev
Author: luc_peuvrier
Date: 2012-05-27 05:07:36 +0000 (Sun, 27 May 2012)
Log Message:
-----------
can setup the prohibited package by security manager, this information is used by proxy class generator
Modified Paths:
--------------
trunk/joafip/doc/_todo.txt
trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/FieldInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/AbstractClassCreator.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/forimport/ClassCreator.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassEnhancer.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/EnhanceCodeGenerator.java
trunk/joafip/src/test/java/net/sf/joafip/service/sync/TestSynchronizedCollection.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreWithBobFileLazy.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/BobPackageVisibility.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyInterceptPackageVisibility.java
trunk/joafip/src/test/resources/log4j.properties
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
Added Paths:
-----------
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/PackageInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/SunPackage.java
Removed Paths:
-------------
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/SunPackage.java
Modified: trunk/joafip/doc/_todo.txt
===================================================================
--- trunk/joafip/doc/_todo.txt 2012-05-26 14:06:26 UTC (rev 3099)
+++ trunk/joafip/doc/_todo.txt 2012-05-27 05:07:36 UTC (rev 3100)
@@ -32,6 +32,8 @@
- persisted class byte code checked for persistence constraints
-- check field access constraints, direct field access disallow to force use of getter and/or setter
-- check private method invocation of other instance
+-- check package visibility method interception
+- can setup the prohibited package by security manager, this information is used by proxy class generator
- static field persistence feature removed because a non sense
- heap file project make able to create a map in file with a comparable key
- new joafip-pmap project, a file persisted tree map
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java 2012-05-26 14:06:26 UTC (rev 3099)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java 2012-05-27 05:07:36 UTC (rev 3100)
@@ -650,6 +650,11 @@
}
@Override
+ public void addProhibitedPackage(final String packageName) {
+ store.addProhibitedPackage(packageName);
+ }
+
+ @Override
public void addToNotCheckMethod(final Class<?> clazz) {
store.addToNotCheckMethod(clazz);
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java 2012-05-26 14:06:26 UTC (rev 3099)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java 2012-05-27 05:07:36 UTC (rev 3100)
@@ -613,6 +613,16 @@
*/
void setForceEnhance(String[] objectClassNames);
+ /**
+ * Add a prohibited package. Ensure proxy class are not created in this
+ * package. When the package of a proxy class is not the same package than
+ * proxied class then method having only package visibility are not overrode
+ * for method call interception<br>
+ *
+ * @param packageName
+ */
+ void addProhibitedPackage(String packageName);
+
void addToNotCheckMethod(Class<?> clazz);
void addToNotCheckMethod(Method method);
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java 2012-05-26 14:06:26 UTC (rev 3099)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java 2012-05-27 05:07:36 UTC (rev 3100)
@@ -55,9 +55,9 @@
import net.sf.joafip.store.entity.objectio.EnumObjectOutput;
import net.sf.joafip.store.entity.objectio.NullMarker;
import net.sf.joafip.store.service.binary.AbstractConverter;
-import net.sf.joafip.store.service.bytecode.SunPackage;
import net.sf.joafip.store.service.classinfo.ClassInfoException;
import net.sf.joafip.store.service.classinfo.IClassInfoFactory;
+import net.sf.joafip.store.service.classinfo.SunPackage;
import net.sf.joafip.store.service.conversion.ConversionException;
import net.sf.joafip.store.service.conversion.def.ConversionManager;
import net.sf.joafip.store.service.objectio.manager.ISubsituteSynchronizer;
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/FieldInfo.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/FieldInfo.java 2012-05-26 14:06:26 UTC (rev 3099)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/FieldInfo.java 2012-05-27 05:07:36 UTC (rev 3100)
@@ -125,7 +125,7 @@
assertNotNull = field.isAnnotationPresent(AssertNotNull.class);
}
- // FIXMELUC ______known field: called ?
+ // FIXMELUC _______known field: called ?
public FieldInfo(final ClassInfo declaringClass, final String fieldName,
final ClassInfo fieldType, final Boolean staticField,
final Boolean transientField) throws ClassInfoException {
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java 2012-05-26 14:06:26 UTC (rev 3099)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java 2012-05-27 05:07:36 UTC (rev 3100)
@@ -245,6 +245,8 @@
void setForceEnhance(String objectClassName);
+ void addProhibitedPackage(String packageName);
+
void addToNotCheckMethod(Class<?> clazz);
void addToNotCheckMethod(Method method);
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-26 14:06:26 UTC (rev 3099)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java 2012-05-27 05:07:36 UTC (rev 3100)
@@ -63,6 +63,7 @@
import net.sf.joafip.store.service.binary.HelperBinaryConversion;
import net.sf.joafip.store.service.classinfo.ClassInfoException;
import net.sf.joafip.store.service.classinfo.ClassInfoFactory;
+import net.sf.joafip.store.service.classinfo.PackageInfo;
import net.sf.joafip.store.service.heaprecordable.HeapRecordableException;
import net.sf.joafip.store.service.objectio.ObjectIOClassNotFoundException;
import net.sf.joafip.store.service.objectio.ObjectIODataCorruptedException;
@@ -103,6 +104,8 @@
@NotStorableClass
public class Store extends AbstractDelegatingToStoreManagers {// NOPMD
+ private final static PackageInfo PACKAGE_INFO = PackageInfo.getInstance();
+
private static final String FILE_ACCESS_SESSION_CLOSED =
/**/"file access session closed";
@@ -643,6 +646,13 @@
}
@Override
+ public void addProhibitedPackage(final String packageName) {
+ synchronized (mutex) {
+ PACKAGE_INFO.addProhibitedPackage(packageName);
+ }
+ }
+
+ @Override
public void addToNotCheckMethod(final Class<?> clazz) {
final Constructor<?>[] constructors = clazz.getDeclaredConstructors();
for (Constructor<?> constructor : constructors) {
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/AbstractClassCreator.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/AbstractClassCreator.java 2012-05-26 14:06:26 UTC (rev 3099)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/AbstractClassCreator.java 2012-05-27 05:07:36 UTC (rev 3100)
@@ -29,6 +29,7 @@
import net.sf.joafip.service.ClassLoaderProvider;
import net.sf.joafip.store.entity.classinfo.ClassInfo;
import net.sf.joafip.store.service.classinfo.ClassInfoFactory;
+import net.sf.joafip.store.service.classinfo.PackageInfo;
/**
*
@@ -40,6 +41,8 @@
protected final JoafipLogger logger = JoafipLogger.getLogger(getClass());// NOPMD
+ private final static PackageInfo PACKAGE_INFO = PackageInfo.getInstance();
+
public final static String JOAFIP_SUFIX = "$Joafip$";
private final static Set<String> noEnhanceMethodNameset = new TreeSet<String>();// NOPMD
@@ -89,8 +92,10 @@
throws EnhanceException {
// ASSERTX
assert objectClassInfo.classExists() : "can not enhance unexisting class";
- String superClassName;
- superClassName = objectClassInfo.getName();
+ // superClassName = objectClassInfo.getName();
+ final Class<?> superClass = objectClassInfo.getObjectClass();
+ final String superClassName = superClass.getName();
+
Class<?> defineClass;
synchronized (AbstractClassCreator.class) {
final Map<Integer, Map<String, Class<?>>> cache = interceptMethodEnd ? createdClassCacheMap
@@ -104,8 +109,41 @@
defineClass = map.get(superClassName);
}
if (defineClass == null) {
- defineClass = doEnhancement(objectClassInfo, superClassName,
- persistenceId, interceptMethodEnd);
+ /*
+ * enhanced class to be created
+ */
+ final String suffix;
+ if (classCreation) {
+ suffix = "Impl" + persistenceId;
+ } else {
+ if (interceptMethodEnd) {
+ suffix = JOAFIP_SUFIX + persistenceId + "i";
+ } else {
+ suffix = JOAFIP_SUFIX + persistenceId;
+ }
+ }
+ final String superClassPackageName = superClass.getPackage()
+ .getName();
+ final String toEnhanceClassName;
+ final String toEnhanceClassPackageName;
+ final boolean overridePublicOnly;
+ if (PACKAGE_INFO.isProhibitedPackage(superClassPackageName)) {
+ toEnhanceClassName = "net.sf.joafip." + superClassName
+ + suffix;
+ toEnhanceClassPackageName = "net.sf.joafip."
+ + superClassPackageName;
+ overridePublicOnly = true;
+ } else {
+ toEnhanceClassName = superClassName + suffix;
+ toEnhanceClassPackageName = superClassPackageName;
+ overridePublicOnly = false;
+ }
+
+ defineClass = doEnhancement(objectClassInfo,
+ superClassPackageName, superClassName,
+ toEnhanceClassPackageName, toEnhanceClassName,
+ persistenceId, interceptMethodEnd, overridePublicOnly);
+
map.put(superClassName, defineClass);
}
}
@@ -119,14 +157,19 @@
*
* @param objectClassInfo
* @param superClassName
+ * @param toEnhanceClassName
* @param persistenceId
* @param interceptMethodEnd
+ * @param overridePublicOnly
* @return the enhanced class
* @throws EnhanceException
*/
private Class<?> doEnhancement(final ClassInfo objectClassInfo,
- final String superClassName, final int persistenceId,
- final boolean interceptMethodEnd) throws EnhanceException {
+ final String superClassPackageName, final String superClassName,
+ final String toEnhanceClassPackageName,
+ final String toEnhanceClassName, final int persistenceId,
+ final boolean interceptMethodEnd, final boolean overridePublicOnly)
+ throws EnhanceException {
Class<?> objectClass;
objectClass = objectClassInfo.getObjectClass();
final int modifiers = objectClass.getModifiers();
@@ -134,30 +177,16 @@
throw new EnhanceException("can not enhance: " + objectClass
+ " is final");
}
- final String suffix;
- if (classCreation) {
- suffix = "Impl" + persistenceId;
- } else {
- if (interceptMethodEnd) {
- suffix = JOAFIP_SUFIX + persistenceId + "i";
- } else {
- suffix = JOAFIP_SUFIX + persistenceId;
- }
- }
- final String toEnhanceClassName;
- if (SunPackage.isSunPackage(superClassName)) {
- toEnhanceClassName = "net.sf.joafip." + superClassName + suffix;
- } else {
- toEnhanceClassName = superClassName + suffix;
- }
- return doEnhancementImpl(objectClassInfo, toEnhanceClassName,
- superClassName, persistenceId, interceptMethodEnd);
+ return doEnhancementImpl(objectClassInfo, toEnhanceClassPackageName,
+ toEnhanceClassName, superClassPackageName, superClassName,
+ persistenceId, interceptMethodEnd, overridePublicOnly);
}
protected abstract Class<?> doEnhancementImpl(ClassInfo objectClassInfo,
- String toEnhanceClassName, String superClassName,
- int persistenceId, boolean interceptMethodEnd)
- throws EnhanceException;
+ String toEnhanceClassPackageName, String toEnhanceClassName,
+ String superClassPackageName, String superClassName,
+ int persistenceId, boolean interceptMethodEnd,
+ boolean overridePublicOnly) throws EnhanceException;
protected boolean isEnhancable(final Method method) {
final String methodName = method.getName();
Deleted: trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/SunPackage.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/SunPackage.java 2012-05-26 14:06:26 UTC (rev 3099)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/SunPackage.java 2012-05-27 05:07:36 UTC (rev 3100)
@@ -1,50 +0,0 @@
-/*
- * Copyright 2008 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.store.service.bytecode;
-
-import net.sf.joafip.NotStorableClass;
-
-/**
- *
- * @author luc peuvrier
- *
- */
-@NotStorableClass
-public final class SunPackage {
-
- public static final String SUNW = "sunw";
-
- public static final String SUN = "sun";
-
- public static final String JAVAX = "javax";
-
- public static final String JAVA = "java";
-
- public static final String COM_SUN = "com.sun";
-
- private SunPackage() {
- super();
- }
-
- public static boolean isSunPackage(final String className) {
- return className.startsWith(COM_SUN)
- || className.startsWith(JAVA)
- /* || className.startsWith(JAVAX) because JAVAX start with JAVA */|| className
- .startsWith(SUN)
- /* || className.startsWith(SUNW) because SUNW start with SUN */;
- }
-}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/forimport/ClassCreator.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/forimport/ClassCreator.java 2012-05-26 14:06:26 UTC (rev 3099)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/forimport/ClassCreator.java 2012-05-27 05:07:36 UTC (rev 3100)
@@ -56,9 +56,11 @@
@Override
protected Class<?> doEnhancementImpl(final ClassInfo objectClassInfo,
- final String toEnhanceClassName, final String superClassName,
- final int persistenceId, final boolean interceptMethodEnd)
- throws EnhanceException {
+ final String toEnhanceClassPackageName,
+ final String toEnhanceClassName,
+ final String superClassPackageName, final String superClassName,
+ final int persistenceId, final boolean interceptMethodEnd,
+ final boolean overridePublicOnly) throws EnhanceException {
final Collection<Class<?>> interfacesClassCollection = new LinkedList<Class<?>>();
Class<?> objectClass;
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassEnhancer.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassEnhancer.java 2012-05-26 14:06:26 UTC (rev 3099)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassEnhancer.java 2012-05-27 05:07:36 UTC (rev 3100)
@@ -16,6 +16,7 @@
*/
package net.sf.joafip.store.service.bytecode.proxy;
+import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
@@ -64,24 +65,29 @@
@Override
protected Class<?> doEnhancementImpl(final ClassInfo objectClassInfo,
- final String toEnhanceClassName, final String superClassName,
- final int persistenceId, final boolean interceptMethodEnd)
- throws EnhanceException {
+ final String toEnhanceClassPackageName,
+ final String toEnhanceClassName,
+ final String superClassPackageName, final String superClassName,
+ final int persistenceId, final boolean interceptMethodEnd,
+ final boolean overridePublicOnly) throws EnhanceException {
final Class<?> defineClass;
try {
CLASS_CONSTRAINT_CHECKER.check(superClassName, classInfoFactory);
final List<Method> methodsList = getMethodsToOverride(objectClassInfo);
final Constructor<?>[] constructors = getConstructors(objectClassInfo);
final byte[] generatedCode = ENHANCE_CODE_GENERATOR.generate(
+ /**/toEnhanceClassPackageName,
/**/toEnhanceClassName,
+ /**/superClassPackageName,
/**/superClassName,
/**/constructors,
/**/methodsList,
- /**/interceptMethodEnd);
+ /**/interceptMethodEnd,
+ /**/overridePublicOnly);
if (LOGGER.debugEnabled) {
LOGGER.debug("generated bytecode wrote to runtime/class/"
+ superClassName + ".class");
- writeByteCode("runtime/class/" + superClassName + ".class",
+ writeByteCode("runtime/class/" + toEnhanceClassName + ".class",
generatedCode);
}
defineClass = defineClass(toEnhanceClassName, generatedCode);
@@ -93,7 +99,12 @@
private void writeByteCode(final String fileName, final byte[] generatedCode) {
try {
- final OutputStream outputStream = new FileOutputStream(fileName);
+ final File file = new File(fileName);
+ final File parent = file.getParentFile();
+ if (parent != null) {
+ parent.mkdirs();
+ }
+ final OutputStream outputStream = new FileOutputStream(file);
outputStream.write(generatedCode, 0, generatedCode.length);
outputStream.close();
} catch (IOException exception) {
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/EnhanceCodeGenerator.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/EnhanceCodeGenerator.java 2012-05-26 14:06:26 UTC (rev 3099)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/EnhanceCodeGenerator.java 2012-05-27 05:07:36 UTC (rev 3100)
@@ -255,10 +255,11 @@
}
}
- public byte[] generate(final String className, final String superClassName,
- final Constructor<?>[] constructors,
- final Collection<Method> methods, final boolean interceptMethodEnd)
- throws EnhanceException {
+ public byte[] generate(final String classPackageName,
+ final String className, final String superClassPackageName,
+ final String superClassName, final Constructor<?>[] constructors,
+ final Collection<Method> methods, final boolean interceptMethodEnd,
+ final boolean overridePublicOnly) throws EnhanceException {
if (!initialized) {
initialize();
}
@@ -292,13 +293,15 @@
// add intercept method begin and end
for (Method method : methods) {
addInterceptCallMethodEndCall(classWriter, classInternalName,
- superClassInternalName, method);
+ superClassInternalName, method, classPackageName,
+ superClassPackageName, overridePublicOnly);
}
} else {
// add intercept method begin only
for (Method method : methods) {
addInterceptCall(classWriter, classInternalName,
- superClassInternalName, method);
+ superClassInternalName, method, classPackageName,
+ superClassPackageName, overridePublicOnly);
}
}
@@ -748,73 +751,86 @@
* @param classWriter
* @param classInternalName
* @param superClassInternalName
- * @param methodInfo
+ * @param method
+ * @param classPackageName
+ * @param superClassPackageName
+ * @param overridePublicOnly
+ * @throws EnhanceException
*/
private void addInterceptCall(final ClassWriter classWriter,
final String classInternalName,
- final String superClassInternalName, final Method method) {
- MethodVisitor methodVisitor;
- final String desc = Type.getMethodDescriptor(method);
- final Class<?>[] exceptionsClass = method.getExceptionTypes();
- final String[] exceptions = new String[exceptionsClass.length];// NOPMD
- for (int index = 0; index < exceptionsClass.length; index++) {
- exceptions[index] = Type.getInternalName(exceptionsClass[index]);
- }
+ final String superClassInternalName, final Method method,
+ final String classPackageName, final String superClassPackageName,
+ final boolean overridePublicOnly) throws EnhanceException {
+ final int methodModifiers = method.getModifiers();
+ if (checkAccess(overridePublicOnly, method, methodModifiers,
+ classPackageName, superClassPackageName)) {
+ MethodVisitor methodVisitor;
+ final String desc = Type.getMethodDescriptor(method);
+ final Class<?>[] exceptionsClass = method.getExceptionTypes();
+ final String[] exceptions = new String[exceptionsClass.length];// NOPMD
+ for (int index = 0; index < exceptionsClass.length; index++) {
+ exceptions[index] = Type
+ .getInternalName(exceptionsClass[index]);
+ }
- // final int access =
- // /**/(Modifier.isPublic(method.getModifiers()) ? ACC_PUBLIC : 0)
- // /**/| (Modifier.isStrict(method.getModifiers()) ? ACC_STRICT
- // : 0)
- // /**/| (Modifier.isSynchronized(method.getModifiers()) ?
- // ACC_SYNCHRONIZED
- // : 0);
- // final int access =method.getModifiers();
- final String methodName = method.getName();
- assert !Modifier.isPrivate(method.getModifiers()) : "method "
- + superClassInternalName + "#" + methodName
- + " must not be private and is: "
- + Modifier.toString(method.getModifiers());
- final int access = ACC_PUBLIC;
- methodVisitor = classWriter.visitMethod(
- /**/access,
- /**/methodName,
- /**/desc,
- /**/null,
- /**/exceptions);
+ // final int access =
+ // /**/(Modifier.isPublic(method.getModifiers()) ? ACC_PUBLIC : 0)
+ // /**/| (Modifier.isStrict(method.getModifiers()) ? ACC_STRICT
+ // : 0)
+ // /**/| (Modifier.isSynchronized(method.getModifiers()) ?
+ // ACC_SYNCHRONIZED
+ // : 0);
+ // final int access =method.getModifiers();
+ final String methodName = method.getName();
+ assert !Modifier.isPrivate(methodModifiers) : "method "
+ + superClassInternalName + "#" + methodName
+ + " must not be private and is: "
+ + Modifier.toString(methodModifiers);
+ // always public even if super method is not public
+ final int access = ACC_PUBLIC;
+ // final int access = computeAccess(method);
+ methodVisitor = classWriter.visitMethod(
+ /**/access,
+ /**/methodName,
+ /**/desc,
+ /**/null,
+ /**/exceptions);
- methodVisitor.visitCode();
+ methodVisitor.visitCode();
- methodVisitor.visitVarInsn(ALOAD, 0);
- methodVisitor.visitMethodInsn(
- /**/INVOKEVIRTUAL,
- /**/classInternalName,
- /**/INTERCEPT_METHOD_NAME,
- /**/interceptMethodDesc);
+ methodVisitor.visitVarInsn(ALOAD, 0);
+ methodVisitor.visitMethodInsn(
+ /**/INVOKEVIRTUAL,
+ /**/classInternalName,
+ /**/INTERCEPT_METHOD_NAME,
+ /**/interceptMethodDesc);
- methodVisitor.visitVarInsn(ALOAD, 0);
- final Class<?>[] parameterTypes = method.getParameterTypes();
- final int numberOfParams = parameterTypes.length;
- int paramSize = 0;
- for (int paramIndex = 0; paramIndex < numberOfParams; paramIndex++) {
- final Type type = Type.getType(parameterTypes[paramIndex]);
- final int opcode = type.getOpcode(ILOAD);
- methodVisitor.visitVarInsn(opcode, paramSize + 1);
- paramSize += type.getSize();
- }
- final Type returnType = Type.getReturnType(method);
+ methodVisitor.visitVarInsn(ALOAD, 0);
+ final Class<?>[] parameterTypes = method.getParameterTypes();
+ final int numberOfParams = parameterTypes.length;
+ int paramSize = 0;
+ for (int paramIndex = 0; paramIndex < numberOfParams; paramIndex++) {
+ final Type type = Type.getType(parameterTypes[paramIndex]);
+ final int opcode = type.getOpcode(ILOAD);
+ methodVisitor.visitVarInsn(opcode, paramSize + 1);
+ paramSize += type.getSize();
+ }
+ final Type returnType = Type.getReturnType(method);
- methodVisitor.visitMethodInsn(
- /**/INVOKESPECIAL,
- /**/superClassInternalName,
- /**/methodName,
- /**/desc);
+ methodVisitor.visitMethodInsn(
+ /**/INVOKESPECIAL,
+ /**/superClassInternalName,
+ /**/methodName,
+ /**/desc);
- final int opcode = returnType.getOpcode(IRETURN);
- methodVisitor.visitInsn(opcode);
+ final int opcode = returnType.getOpcode(IRETURN);
+ methodVisitor.visitInsn(opcode);
- // FIXMELUC _visitmaxs call needed ?
- methodVisitor.visitMaxs(0, 0);
- methodVisitor.visitEnd();
+ // FIXMELUC _visitmaxs call needed ?
+ methodVisitor.visitMaxs(0, 0);
+ methodVisitor.visitEnd();
+ }
}
/**
@@ -823,113 +839,161 @@
* @param classWriter
* @param classInternalName
* @param superClassInternalName
- * @param methodInfo
+ * @param method
+ * @param classPackageName
+ * @param superClassPackageName
+ * @param overridePublicOnly
+ * @throws EnhanceException
*/
private void addInterceptCallMethodEndCall(final ClassWriter classWriter,
final String classInternalName,
- final String superClassInternalName, final Method method) {
- MethodVisitor methodVisitor;
- final String desc = Type.getMethodDescriptor(method);
- final Class<?>[] exceptionsClass = method.getExceptionTypes();
- final String[] exceptions = new String[exceptionsClass.length];// NOPMD
- for (int index = 0; index < exceptionsClass.length; index++) {
- exceptions[index] = Type.getInternalName(exceptionsClass[index]);
- }
+ final String superClassInternalName, final Method method,
+ final String classPackageName, final String superClassPackageName,
+ final boolean overridePublicOnly) throws EnhanceException {
+ final int methodModifiers = method.getModifiers();
+ if (checkAccess(overridePublicOnly, method, methodModifiers,
+ classPackageName, superClassPackageName)) {
- // final int access =
- // /**/(Modifier.isPublic(method.getModifiers()) ? ACC_PUBLIC : 0)
- // /**/| (Modifier.isStrict(method.getModifiers()) ? ACC_STRICT
- // : 0)
- // /**/| (Modifier.isSynchronized(method.getModifiers()) ?
- // ACC_SYNCHRONIZED
- // : 0);
- // // final int access =ACC_PUBLIC;
- // // final int access =method.getModifiers();
- final String methodName = method.getName();
- assert !Modifier.isPrivate(method.getModifiers()) : "method "
- + superClassInternalName + "#" + methodName
- + " must not be private and is: "
- + Modifier.toString(method.getModifiers());
- final int access = ACC_PUBLIC;
- methodVisitor = classWriter.visitMethod(
- /**/access,
- /**/methodName,
- /**/desc,
- /**/null,
- /**/exceptions);
+ MethodVisitor methodVisitor;
+ final String desc = Type.getMethodDescriptor(method);
+ final Class<?>[] exceptionsClass = method.getExceptionTypes();
+ final String[] exceptions = new String[exceptionsClass.length];// NOPMD
+ for (int index = 0; index < exceptionsClass.length; index++) {
+ exceptions[index] = Type
+ .getInternalName(exceptionsClass[index]);
+ }
- methodVisitor.visitCode();
+ // final int access =
+ // /**/(Modifier.isPublic(method.getModifiers()) ? ACC_PUBLIC : 0)
+ // /**/| (Modifier.isStrict(method.getModifiers()) ? ACC_STRICT
+ // : 0)
+ // /**/| (Modifier.isSynchronized(method.getModifiers()) ?
+ // ACC_SYNCHRONIZED
+ // : 0);
+ // // final int access =ACC_PUBLIC;
+ // // final int access =method.getModifiers();
+ final String methodName = method.getName();
+ assert !Modifier.isPrivate(methodModifiers) : "method "
+ + superClassInternalName + "#" + methodName
+ + " must not be private and is: "
+ + Modifier.toString(methodModifiers);
+ // always public even if super method is not public
+ final int access = ACC_PUBLIC;
+ // final int access = computeAccess(method);
+ methodVisitor = classWriter.visitMethod(
+ /**/access,
+ /**/methodName,
+ /**/desc,
+ /**/null,
+ /**/exceptions);
- final Label label0 = new Label();
- final Label label1 = new Label();
- final Label label2 = new Label();
- methodVisitor.visitTryCatchBlock(label0, label1, label2, null);
+ methodVisitor.visitCode();
- methodVisitor.visitLabel(label0);
- methodVisitor.visitVarInsn(ALOAD, 0);
- methodVisitor.visitMethodInsn(
- /**/INVOKEVIRTUAL,
- /**/classInternalName,
- /**/INTERCEPT_METHOD_NAME,
- /**/interceptMethodDesc);
+ final Label label0 = new Label();
+ final Label label1 = new Label();
+ final Label label2 = new Label();
+ methodVisitor.visitTryCatchBlock(label0, label1, label2, null);
- methodVisitor.visitVarInsn(ALOAD, 0);
- final Class<?>[] parameterTypes = method.getParameterTypes();
- final int numberOfParams = parameterTypes.length;
- int paramSize = 0;
- for (int paramIndex = 0; paramIndex < numberOfParams...
[truncated message content] |
|
From: <luc...@us...> - 2012-05-28 17:05:09
|
Revision: 3101
http://joafip.svn.sourceforge.net/joafip/?rev=3101&view=rev
Author: luc_peuvrier
Date: 2012-05-28 17:05:02 +0000 (Mon, 28 May 2012)
Log Message:
-----------
added PCollections and persitable collection wrapper as java.util.Collections
Modified Paths:
--------------
trunk/joafip/doc/_todo.txt
trunk/joafip/src/test/java/net/sf/joafip/service/sync/TestSynchronizedCollection.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PAbstractCollection.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PAbstractList.java
trunk/joafip-log4j/src/test/java/net/sf/joafip/logger/TestCreateLogger.java
Added Paths:
-----------
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PListIterator.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PCollections.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PCopiesList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PEmptyList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PEmptyMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PEmptySet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PLIFOQueue.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PNoModificiantIterator.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PNoModificiantListIterator.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PNoModificiantMapEntryIterator.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PReverseComparatorOfComparator.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PReverseComparatorOfNaturalOrder.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSetFromMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSingletonList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSingletonMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSingletonSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSynchronizedCollection.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSynchronizedIterator.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSynchronizedList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSynchronizedListIterator.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSynchronizedMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSynchronizedSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSynchronizedSortedMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSynchronizedSortedSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PUnmodifiableCollection.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PUnmodifiableEntry.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PUnmodifiableEntrySet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PUnmodifiableList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PUnmodifiableMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PUnmodifiableSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PUnmodifiableSortedMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PUnmodifiableSortedSet.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2012-05-28 17:05:12
|
Revision: 3101
http://joafip.svn.sourceforge.net/joafip/?rev=3101&view=rev
Author: luc_peuvrier
Date: 2012-05-28 17:05:02 +0000 (Mon, 28 May 2012)
Log Message:
-----------
added PCollections and persitable collection wrapper as java.util.Collections
Modified Paths:
--------------
trunk/joafip/doc/_todo.txt
trunk/joafip/src/test/java/net/sf/joafip/service/sync/TestSynchronizedCollection.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PAbstractCollection.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PAbstractList.java
trunk/joafip-log4j/src/test/java/net/sf/joafip/logger/TestCreateLogger.java
Added Paths:
-----------
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PListIterator.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PCollections.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PCopiesList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PEmptyList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PEmptyMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PEmptySet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PLIFOQueue.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PNoModificiantIterator.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PNoModificiantListIterator.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PNoModificiantMapEntryIterator.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PReverseComparatorOfComparator.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PReverseComparatorOfNaturalOrder.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSetFromMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSingletonList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSingletonMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSingletonSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSynchronizedCollection.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSynchronizedIterator.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSynchronizedList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSynchronizedListIterator.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSynchronizedMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSynchronizedSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSynchronizedSortedMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PSynchronizedSortedSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PUnmodifiableCollection.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PUnmodifiableEntry.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PUnmodifiableEntrySet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PUnmodifiableList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PUnmodifiableMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PUnmodifiableSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PUnmodifiableSortedMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PUnmodifiableSortedSet.java
Modified: trunk/joafip/doc/_todo.txt
===================================================================
--- trunk/joafip/doc/_todo.txt 2012-05-27 05:07:36 UTC (rev 3100)
+++ trunk/joafip/doc/_todo.txt 2012-05-28 17:05:02 UTC (rev 3101)
@@ -94,6 +94,8 @@
currently:
-------------------------------------------------------------------------------------
+Queue implementations
+
file input/output stream
- existing FileOutputStreamNIO
- create FileOutputStreamMapped to use instead of FileOutputStreamNIO
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/sync/TestSynchronizedCollection.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/sync/TestSynchronizedCollection.java 2012-05-27 05:07:36 UTC (rev 3100)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/sync/TestSynchronizedCollection.java 2012-05-28 17:05:02 UTC (rev 3101)
@@ -1,6 +1,5 @@
package net.sf.joafip.service.sync;
-import java.util.Collections;
import java.util.Map;
import net.sf.joafip.AbstractDeleteFileTestCase;
@@ -9,6 +8,7 @@
import net.sf.joafip.TestException;
import net.sf.joafip.entity.EnumFilePersistenceCloseAction;
import net.sf.joafip.java.util.PTreeMap;
+import net.sf.joafip.java.util.collections.PCollections;
import net.sf.joafip.kvstore.entity.EnumFileAccessMode;
import net.sf.joafip.service.FilePersistenceBuilder;
import net.sf.joafip.service.FilePersistenceClassNotFoundException;
@@ -70,15 +70,10 @@
FilePersistenceDataCorruptedException,
FilePersistenceNotSerializableException,
FilePersistenceTooBigForSerializationException {
- // FIXMELUC ______________known problem to solve
- if (buildMode) {
- warnSkipped();
- return;
- }
final IDataAccessSession session = filePersistence
.createDataAccessSession();
PTreeMap<String, String> map = new PTreeMap<String, String>();
- Map<String, String> smap = Collections.synchronizedMap(map);
+ Map<String, String> smap = PCollections.synchronizedMap(null, map);
smap.put(KEY, "value");
session.open();
session.setObject(KEY, smap);
Modified: trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PAbstractCollection.java
===================================================================
--- trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PAbstractCollection.java 2012-05-27 05:07:36 UTC (rev 3100)
+++ trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PAbstractCollection.java 2012-05-28 17:05:02 UTC (rev 3101)
@@ -41,10 +41,12 @@
super();
}
+ @Override
public boolean isEmpty() {
return size() == 0;
}
+ @Override
public boolean contains(final Object object) {
final Iterator<E> iterator = iterator();
boolean found = false;
@@ -60,6 +62,7 @@
return found;
}
+ @Override
public Object[] toArray() {
final Object[] array = new Object[size()];
final Iterator<E> iterator = iterator();
@@ -77,6 +80,7 @@
}
@SuppressWarnings("unchecked")
+ @Override
public <T> T[] toArray(final T[] toFillArray) {
final int size = size();
final T[] resultArray = toFillArray.length >= size ? toFillArray
@@ -96,6 +100,7 @@
return resultArray;
}
+ @Override
public boolean remove(final Object object) {
final Iterator<E> iterator = iterator();
boolean remove = false;
@@ -117,6 +122,7 @@
return remove;
}
+ @Override
public boolean containsAll(final Collection<?> collection) {
final Iterator<?> iterator = collection.iterator();
boolean containsAll = true;
@@ -126,6 +132,7 @@
return containsAll;
}
+ @Override
public boolean addAll(final Collection<? extends E> collection) {
boolean modified = false;
final Iterator<? extends E> iterator = collection.iterator();
@@ -135,6 +142,7 @@
return modified;
}
+ @Override
public boolean removeAll(final Collection<?> collection) {
boolean modified = false;
final Iterator<?> iterator = iterator();
@@ -147,6 +155,7 @@
return modified;
}
+ @Override
public boolean retainAll(final Collection<?> collection) {
boolean modified = false;
final Iterator<E> iterator = iterator();
@@ -159,14 +168,16 @@
return modified;
}
- // public void clear() {
- // Iterator<E> e = iterator();
- // while (e.hasNext()) {
- // e.next();
- // e.remove();
- // }
- // }
+ @Override
+ public void clear() {
+ final Iterator<E> iterator = iterator();
+ while (iterator.hasNext()) {
+ iterator.next();
+ iterator.remove();
+ }
+ }
+ @Override
public String toString() {
final Iterator<E> iterator = iterator();
final StringBuilder stringBuilder = new StringBuilder();
Modified: trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PAbstractList.java
===================================================================
--- trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PAbstractList.java 2012-05-27 05:07:36 UTC (rev 3100)
+++ trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PAbstractList.java 2012-05-28 17:05:02 UTC (rev 3101)
@@ -22,6 +22,8 @@
*/
package net.sf.joafip.java.util;
+import java.util.Collection;
+import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
@@ -87,9 +89,74 @@
return -1;
}
+ @Override
+ public E get(final int index) {
+ if (index < 0 || index >= size()) {
+ throw new IndexOutOfBoundsException("bad index " + index
+ + ", size is " + size());
+ }
+ E element = null;
+ final ListIterator<E> iterator = listIterator();
+ int count = -1;
+ while (count != index && iterator.hasNext()) {
+ element = iterator.next();
+ count++;
+ }
+ return element;
+ }
+
+ @Override
+ public boolean add(final E element) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void add(final int index, final E element) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public E set(final int index, final E element) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public E remove(final int index) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean addAll(final int startIndex,
+ final Collection<? extends E> collection) {
+ boolean modified = false;
+ final Iterator<? extends E> iterator = collection.iterator();
+ int index = startIndex;
+ while (iterator.hasNext()) {
+ add(index++, iterator.next());
+ modified = true;
+ }
+ return modified;
+ }
+
+ @Override
+ public Iterator<E> iterator() {
+ return listIterator();
+ }
+
+ @Override
+ public ListIterator<E> listIterator() {
+ return listIterator(0);
+ }
+
@SuppressWarnings("unchecked")
+ @Override
+ public ListIterator<E> listIterator(final int index) {
+ return PListIterator.newInstance(instanceFactory, this, index);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
public List<E> subList(final int fromIndex, final int toIndex) {
- // return new PSubList<E>(this, fromIndex, toIndex);
return PSubList.newInstance(instanceFactory, this, fromIndex, toIndex);
}
}
Added: trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PListIterator.java
===================================================================
--- trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PListIterator.java (rev 0)
+++ trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PListIterator.java 2012-05-28 17:05:02 UTC (rev 3101)
@@ -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.java.util;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.NoSuchElementException;
+
+import net.sf.joafip.StorableClass;
+import net.sf.joafip.StoreNotUseStandardSerialization;
+import net.sf.joafip.store.service.proxy.IInstanceFactory;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ * @param <E>
+ */
+@StorableClass
+@StoreNotUseStandardSerialization
+public class PListIterator<E> implements ListIterator<E>, Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -4637923261983954941L;
+
+ private final List<E> list;
+
+ private int index;
+
+ private int lastIndex = -1;
+
+ public PListIterator(final List<E> list, final int index) {
+ super();
+ if (index < 0 || index >= list.size()) {
+ throw new IndexOutOfBoundsException("bad index " + index
+ + " size is " + list.size());
+ }
+ this.list = list;
+ this.index = index;
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public static ListIterator newInstance(
+ final IInstanceFactory instanceFactory, final List list,
+ final int index) {
+ final ListIterator newInstance;
+ if (instanceFactory == null) {
+ newInstance = new PListIterator(list, index);
+ } else {
+ newInstance = (ListIterator) instanceFactory.newInstance(
+ PListIterator.class, new Class[] { List.class, int.class },
+ new Object[] { list, index });
+ }
+ return newInstance;
+
+ }
+
+ @Override
+ public boolean hasNext() {
+ return index < list.size();
+ }
+
+ @Override
+ public E next() {
+ if (index == list.size()) {
+ throw new NoSuchElementException();
+ }
+ lastIndex = index++;
+ return list.get(lastIndex);
+ }
+
+ @Override
+ public boolean hasPrevious() {
+ return index > 0;
+ }
+
+ @Override
+ public E previous() {
+ if (index == 0) {
+ throw new NoSuchElementException();
+ }
+ lastIndex = --index;
+ return list.get(lastIndex);
+ }
+
+ @Override
+ public int nextIndex() {
+ return index;
+ }
+
+ @Override
+ public int previousIndex() {
+ return index - 1;
+ }
+
+ @Override
+ public void remove() {
+ if (lastIndex == -1) {
+ throw new IllegalStateException();
+ }
+ list.remove(lastIndex);
+ if (lastIndex == index) {
+ index--;
+ } else {
+ index++;
+ }
+ lastIndex = -1;
+ }
+
+ @Override
+ public void set(final E element) {
+ if (lastIndex == -1) {
+ throw new IllegalStateException();
+ }
+ list.set(lastIndex, element);
+ lastIndex = -1;
+ }
+
+ @Override
+ public void add(final E element) {
+ list.add(index, element);
+ index++;
+ }
+}
Added: trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PCollections.java
===================================================================
--- trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PCollections.java (rev 0)
+++ trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PCollections.java 2012-05-28 17:05:02 UTC (rev 3101)
@@ -0,0 +1,208 @@
+/*
+ * 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.java.util.collections;
+
+import java.util.Collection;
+import java.util.Deque;
+import java.util.List;
+import java.util.Map;
+import java.util.Queue;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.SortedSet;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.StorableAccess;
+import net.sf.joafip.store.service.proxy.IInstanceFactory;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+@StorableAccess
+public final class PCollections {
+
+ private static final String UNCHECKED = "unchecked";
+
+ private PCollections() {
+ super();
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> Collection<T> unmodifiableCollection(
+ final IInstanceFactory instanceFactory,
+ final Collection<? extends T> collection) {
+ return PUnmodifiableCollection.newInstance(instanceFactory, collection);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> Set<T> unmodifiableSet(
+ final IInstanceFactory instanceFactory, final Set<? extends T> set) {
+ return PUnmodifiableSet.newInstance(instanceFactory, set);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> SortedSet<T> unmodifiableSortedSet(
+ final IInstanceFactory instanceFactory, final SortedSet<T> set) {
+ return PUnmodifiableSortedSet.newInstance(instanceFactory, set);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> List<T> unmodifiableList(
+ final IInstanceFactory instanceFactory, final List<? extends T> list) {
+ return PUnmodifiableList.newInstance(instanceFactory, list);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <K, V> Map<K, V> unmodifiableMap(
+ final IInstanceFactory instanceFactory,
+ final Map<? extends K, ? extends V> map) {
+ return PUnmodifiableMap.newInstance(instanceFactory, map);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <K, V> SortedMap<K, V> unmodifiableSortedMap(
+ final IInstanceFactory instanceFactory,
+ final SortedMap<K, ? extends V> map) {
+ return PUnmodifiableSortedMap.newInstance(null, map);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> Collection<T> synchronizedCollection(
+ final IInstanceFactory instanceFactory,
+ final Collection<T> collection) {
+ return PSynchronizedCollection.newInstance(instanceFactory, collection);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> Collection<T> synchronizedCollection(
+ final IInstanceFactory instanceFactory,
+ final Collection<T> collection, final Object mutex) {
+ return PSynchronizedCollection.newInstance(instanceFactory, collection,
+ mutex);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> Set<T> synchronizedSet(
+ final IInstanceFactory instanceFactory, final Set<T> set) {
+ return PSynchronizedSet.newInstance(instanceFactory, set);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> Set<T> synchronizedSet(
+ final IInstanceFactory instanceFactory, final Set<T> set,
+ final Object mutex) {
+ return PSynchronizedSet.newInstance(instanceFactory, set, mutex);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> SortedSet<T> synchronizedSortedSet(
+ final IInstanceFactory instanceFactory, final SortedSet<T> set) {
+ return PSynchronizedSortedSet.newInstance(instanceFactory, set);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> List<T> synchronizedList(
+ final IInstanceFactory instanceFactory, final List<T> list) {
+ return PSynchronizedList.newInstance(instanceFactory, list);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> List<T> synchronizedList(
+ final IInstanceFactory instanceFactory, final List<T> list,
+ final Object mutex) {
+ return PSynchronizedList.newInstance(instanceFactory, list, mutex);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <K, V> Map<K, V> synchronizedMap(
+ final IInstanceFactory instanceFactory, final Map<K, V> map) {
+ return PSynchronizedMap.newInstance(instanceFactory, map);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <K, V> SortedMap<K, V> synchronizedSortedMap(
+ final IInstanceFactory instanceFactory, final SortedMap<K, V> map) {
+ return PSynchronizedSortedMap.newInstance(instanceFactory, map);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> Set<T> emptySet(final IInstanceFactory instanceFactory) {
+ return (Set<T>) PEmptySet.newInstance(instanceFactory);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> List<T> emptyList(final IInstanceFactory instanceFactory) {
+ return (List<T>) PEmptyList.newInstance(instanceFactory);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <K, V> Map<K, V> emptyMap(
+ final IInstanceFactory instanceFactory) {
+ return (Map<K, V>) PEmptyMap.newInstance(instanceFactory);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> Set<T> singleton(final IInstanceFactory instanceFactory,
+ final T element) {
+ return PSingletonSet.newInstance(instanceFactory, element);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> List<T> singletonList(
+ final IInstanceFactory instanceFactory, final T element) {
+ return PSingletonList.newInstance(instanceFactory, element);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <K, V> Map<K, V> singletonMap(
+ final IInstanceFactory instanceFactory, final K key, final V value) {
+ return PSingletonMap.newInstance(instanceFactory, key, value);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> List<T> nCopies(final IInstanceFactory instanceFactory,
+ final int numberOfElement, final T element) {
+ if (numberOfElement < 0) {
+ throw new IllegalArgumentException("List length = "
+ + numberOfElement);
+ }
+ return PCopiesList.newInstance(instanceFactory, numberOfElement,
+ element);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <E> Set<E> newSetFromMap(
+ final IInstanceFactory instanceFactory, final Map<E, Boolean> map) {
+ return PSetFromMap.newInstance(instanceFactory, map);
+ }
+
+ @SuppressWarnings(UNCHECKED)
+ public static <T> Queue<T> asLifoQueue(
+ final IInstanceFactory instanceFactory, final Deque<T> deque) {
+ return PLIFOQueue.newInstance(instanceFactory, deque);
+ }
+}
Added: trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PCopiesList.java
===================================================================
--- trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PCopiesList.java (rev 0)
+++ trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PCopiesList.java 2012-05-28 17:05:02 UTC (rev 3101)
@@ -0,0 +1,170 @@
+/*
+ * 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.java.util.collections;
+
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.RandomAccess;
+
+import net.sf.joafip.StorableClass;
+import net.sf.joafip.StoreNotUseStandardSerialization;
+import net.sf.joafip.java.util.PAbstractList;
+import net.sf.joafip.store.service.proxy.IInstanceFactory;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ * @param <E>
+ */
+@StorableClass
+@StoreNotUseStandardSerialization
+public class PCopiesList<E> extends PAbstractList<E> implements RandomAccess,
+ Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -330760604684424582L;
+
+ private final int numberOfElement;
+
+ private final E element;
+
+ /**
+ *
+ * @param numberOfElement
+ * the number of elements in the returned list.
+ * @param element
+ * the element to appear repeatedly in the returned list.
+ */
+ public PCopiesList(final IInstanceFactory instanceFactory,
+ final int numberOfElement, final E element) {
+ super(instanceFactory);
+ if (numberOfElement < 0) {
+ throw new IllegalArgumentException("bad number of elements "
+ + numberOfElement);
+ }
+ this.numberOfElement = numberOfElement;
+ this.element = element;
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public static PCopiesList newInstance(
+ final IInstanceFactory instanceFactory, final int numberOfElement,
+ final Object element) {
+ final PCopiesList newInstance;
+ if (instanceFactory == null) {
+ newInstance = new PCopiesList(instanceFactory, numberOfElement,
+ element);
+ } else {
+ newInstance = (PCopiesList) instanceFactory.newInstance(
+ PCopiesList.class, new Class<?>[] { IInstanceFactory.class,
+ int.class, Object.class }, new Object[] {
+ instanceFactory, numberOfElement, element });
+ }
+ return newInstance;
+ }
+
+ public int size() {
+ return numberOfElement;
+ }
+
+ public boolean contains(final Object object) {
+ return numberOfElement != 0
+ && ((element == null && object == null) || element
+ .equals(object));
+ }
+
+ public int indexOf(final Object object) {
+ return contains(object) ? 0 : -1;
+ }
+
+ public int lastIndexOf(final Object object) {
+ return contains(object) ? numberOfElement - 1 : -1;
+ }
+
+ public E get(final int index) {
+ if (index < 0 || index >= numberOfElement) {
+ throw new IndexOutOfBoundsException("Index: " + index + ", Size: "
+ + numberOfElement);
+ }
+ return element;
+ }
+
+ public Object[] toArray() {
+ final Object[] array = new Object[numberOfElement];
+ if (element != null) {
+ Arrays.fill(array, 0, numberOfElement, element);
+ }
+ return array;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T[] toArray(final T[] array) {
+ final T[] result;
+ if (array.length < numberOfElement) {
+ result = (T[]) java.lang.reflect.Array.newInstance(array.getClass()
+ .getComponentType(), numberOfElement);
+ if (element != null) {
+ Arrays.fill(result, 0, numberOfElement, element);
+ }
+ } else {
+ result = array;
+ Arrays.fill(result, 0, numberOfElement, element);
+ if (result.length > numberOfElement) {
+ result[numberOfElement] = null;
+ }
+ }
+ return result;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public List<E> subList(final int fromIndex, final int toIndex) {
+ if (fromIndex < 0) {
+ throw new IndexOutOfBoundsException("fromIndex = " + fromIndex);
+ }
+ if (toIndex > numberOfElement) {
+ throw new IndexOutOfBoundsException("toIndex = " + toIndex);
+ }
+ if (fromIndex > toIndex) {
+ throw new IllegalArgumentException("fromIndex(" + fromIndex
+ + ") > toIndex(" + toIndex + ")");
+ }
+ return new PCopiesList(instanceFactory, toIndex - fromIndex, element);
+ }
+
+ @Override
+ public boolean addAll(final int index,
+ final Collection<? extends E> collection) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void clear() {
+ throw new UnsupportedOperationException();
+ }
+}
Added: trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PEmptyList.java
===================================================================
--- trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PEmptyList.java (rev 0)
+++ trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/collections/PEmptyList.java 2012-05-28 17:05:02 UTC (rev 3101)
@@ -0,0 +1,77 @@
+/*
+ * 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.java.util.collections;
+
+import java.io.Serializable;
+import java.util.RandomAccess;
+
+import net.sf.joafip.StorableClass;
+import net.sf.joafip.StoreNotUseStandardSerialization;
+import net.sf.joafip.java.util.PAbstractList;
+import net.sf.joafip.store.service.proxy.IInstanceFactory;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@StorableClass
+@StoreNotUseStandardSerialization
+public class PEmptyList extends PAbstractList<Object> implements RandomAccess,
+ Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -6982042931492196527L;
+
+ public PEmptyList(final IInstanceFactory instanceFactory) {
+ super(instanceFactory);
+ }
+
+ public static PEmptyList newInstance(final IInstanceFactory instanceFactory) {
+ final PEmptyList newInstance;
+ if (instanceFactory == null) {
+ newInstance = new PEmptyList(instanceFactory);
+ } else {
+ newInstance = (PEmptyList) instanceFactory.newInstance(
+ PEmptyList.class,
+ new Class<?>[] { IInstanceFactory....
[truncated message content] |