[Joafip-svn] SF.net SVN: joafip:[2999] trunk
Brought to you by:
luc_peuvrier
|
From: <luc...@us...> - 2012-04-09 05:41:34
|
Revision: 2999
http://joafip.svn.sourceforge.net/joafip/?rev=2999&view=rev
Author: luc_peuvrier
Date: 2012-04-09 05:41:25 +0000 (Mon, 09 Apr 2012)
Log Message:
-----------
data manager using jdbm library
Modified Paths:
--------------
trunk/joafip-4test/pom.xml
trunk/joafip-common/src/main/java/net/sf/joafip/logger/DummyLogger.java
trunk/joafip-common/src/main/java/net/sf/joafip/logger/JoafipLogger.java
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/BlockDataManager.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/DualWrapDataManager.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/HeapMemoryDataManagerMock.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/HeapMultiFileDataManager.java
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/IHeapDataManager.java
trunk/joafip-parent/pom.xml
Added Paths:
-----------
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterJdbm.java
trunk/joafip-jdbm/.classpath
trunk/joafip-jdbm/.pmd
trunk/joafip-jdbm/.project
trunk/joafip-jdbm/.ruleset
trunk/joafip-jdbm/.settings/
trunk/joafip-jdbm/.settings/org.eclipse.core.resources.prefs
trunk/joafip-jdbm/.settings/org.eclipse.jdt.core.prefs
trunk/joafip-jdbm/.settings/org.eclipse.m2e.core.prefs
trunk/joafip-jdbm/pom.xml
trunk/joafip-jdbm/src/
trunk/joafip-jdbm/src/main/
trunk/joafip-jdbm/src/main/java/
trunk/joafip-jdbm/src/main/java/net/
trunk/joafip-jdbm/src/main/java/net/sf/
trunk/joafip-jdbm/src/main/java/net/sf/joafip/
trunk/joafip-jdbm/src/main/java/net/sf/joafip/jdbm/
trunk/joafip-jdbm/src/main/java/net/sf/joafip/jdbm/entity/
trunk/joafip-jdbm/src/main/java/net/sf/joafip/jdbm/service/
trunk/joafip-jdbm/src/main/java/net/sf/joafip/jdbm/service/JdbmDataManager.java
trunk/joafip-jdbm/src/main/resources/
trunk/joafip-jdbm/src/test/
trunk/joafip-jdbm/src/test/java/
trunk/joafip-jdbm/src/test/resources/
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/service/AbstractHeapDataManager.java
trunk/joafip-log4j/src/test/java/net/
trunk/joafip-log4j/src/test/java/net/sf/
trunk/joafip-log4j/src/test/java/net/sf/joafip/
trunk/joafip-log4j/src/test/java/net/sf/joafip/logger/
trunk/joafip-log4j/src/test/java/net/sf/joafip/logger/TestCreateLogger.java
Removed Paths:
-------------
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/AbstractHeapDataManager.java
Modified: trunk/joafip-4test/pom.xml
===================================================================
--- trunk/joafip-4test/pom.xml 2012-04-09 05:37:59 UTC (rev 2998)
+++ trunk/joafip-4test/pom.xml 2012-04-09 05:41:25 UTC (rev 2999)
@@ -51,6 +51,12 @@
<dependency>
<groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-jdbm</artifactId>
+ <version>4.0.0b8</version>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
<artifactId>joafip-rbtree</artifactId>
<version>4.0.0b8</version>
</dependency>
Added: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterJdbm.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterJdbm.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterJdbm.java 2012-04-09 05:41:25 UTC (rev 2999)
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.performance.items.service;//NOPMD
+
+import java.io.File;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.StorableAccess;
+import net.sf.joafip.jdbm.service.JdbmDataManager;
+import net.sf.joafip.kvstore.service.IHeapDataManager;
+import net.sf.joafip.logger.JoafipLogger;
+import net.sf.joafip.service.FilePersistenceClassNotFoundException;
+import net.sf.joafip.service.FilePersistenceDataCorruptedException;
+import net.sf.joafip.service.FilePersistenceException;
+import net.sf.joafip.service.FilePersistenceInvalidClassException;
+import net.sf.joafip.service.FilePersistenceNotSerializableException;
+import net.sf.joafip.service.FilePersistenceTooBigForSerializationException;
+import net.sf.joafip.store.service.StoreClassNotFoundException;
+
+@SuppressWarnings("PMD")
+@NotStorableClass
+@StorableAccess
+public class InserterJdbm extends AbstractInserter {
+
+ private static final JoafipLogger LOGGER = JoafipLogger
+ .getLogger(InserterJdbm.class);
+
+ public InserterJdbm(final IHeapDataManager dataManager) throws FilePersistenceException,
+ FilePersistenceInvalidClassException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceDataCorruptedException, StoreClassNotFoundException,
+ FilePersistenceTooBigForSerializationException {
+ super(dataManager);
+ }
+
+ public static void main(final String[] args) {
+ /* remove existing data */
+ final File dataDirectory = new File(RUNTIME_DIR);
+ for (final File file : dataDirectory.listFiles()) {
+ file.delete();
+ }
+ dataDirectory.mkdirs();
+ InserterJdbm inserter;
+ try {
+ final JdbmDataManager bananaDataManager=new JdbmDataManager((new File(dataDirectory,"banana.data")).getAbsolutePath());
+ inserter = new InserterJdbm(bananaDataManager);
+ inserter.run(NUMBER_OF_ITEM);
+ inserter.close();
+ } catch (final Throwable throwable) {// NOPMD catch all
+ LOGGER.fatal("error", throwable);
+ }
+ }
+}
Modified: trunk/joafip-common/src/main/java/net/sf/joafip/logger/DummyLogger.java
===================================================================
--- trunk/joafip-common/src/main/java/net/sf/joafip/logger/DummyLogger.java 2012-04-09 05:37:59 UTC (rev 2998)
+++ trunk/joafip-common/src/main/java/net/sf/joafip/logger/DummyLogger.java 2012-04-09 05:41:25 UTC (rev 2999)
@@ -27,66 +27,73 @@
* @author luc peuvrier
*
*/
+@SuppressWarnings("PMD")
public class DummyLogger implements IJoafipLogger {
@Override
public void debug(final Object message) {
- // no implementation
+ System.err.println("debug: "+message);
}
@Override
public void debug(final Object message, final Throwable throwable) {
- // no implementation
+ System.err.println("debug: "+message);
+ throwable.printStackTrace();
}
@Override
public void trace(final Object message) {
- // no implementation
+ System.err.println("trace: "+message);
}
@Override
public void trace(final Object message, final Throwable throwable) {
- // no implementation
+ System.err.println("trace: "+message);
+ throwable.printStackTrace();
}
@Override
public void info(final Object message) {
- // no implementation
+ System.err.println("info: "+message);
}
@Override
public void info(final Object message, final Throwable throwable) {
- // no implementation
+ System.err.println("info: "+message);
+ throwable.printStackTrace();
}
@Override
public void warn(final Object message) {
- // no implementation
+ System.err.println("warn: "+message);
}
@Override
public void warn(final Object message, final Throwable throwable) {
- // no implementation
+ System.err.println("warn: "+message);
+ throwable.printStackTrace();
}
@Override
public void error(final Object message) {
- // no implementation
+ System.err.println("error: "+message);
}
@Override
public void error(final Object message, final Throwable throwable) {
- // no implementation
+ System.err.println("error: "+message);
+ throwable.printStackTrace();
}
@Override
public void fatal(final Object message) {
- // no implementation
+ System.err.println("fatal: "+message);
}
@Override
public void fatal(final Object message, final Throwable throwable) {
- // no implementation
+ System.err.println("fatal: "+message);
+ throwable.printStackTrace();
}
@Override
Modified: trunk/joafip-common/src/main/java/net/sf/joafip/logger/JoafipLogger.java
===================================================================
--- trunk/joafip-common/src/main/java/net/sf/joafip/logger/JoafipLogger.java 2012-04-09 05:37:59 UTC (rev 2998)
+++ trunk/joafip-common/src/main/java/net/sf/joafip/logger/JoafipLogger.java 2012-04-09 05:41:25 UTC (rev 2999)
@@ -65,8 +65,9 @@
}
if (inStream == null) {
System.err.println(// NOPMD
- /**/"failed to find " + JOAFIP_LOGGER_PROPERTIES
- + " resource");
+ /**/JoafipLogger.class.getName()
+ + ": failed to find "
+ + JOAFIP_LOGGER_PROPERTIES + " resource");
loggerFactory = new DummyLoggerFactory();
} else {
final Properties properties = new Properties();
Deleted: trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/AbstractHeapDataManager.java
===================================================================
--- trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/AbstractHeapDataManager.java 2012-04-09 05:37:59 UTC (rev 2998)
+++ trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/AbstractHeapDataManager.java 2012-04-09 05:41:25 UTC (rev 2999)
@@ -1,701 +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.heapfile.service;
-
-import java.io.Serializable;
-import java.util.Iterator;
-import java.util.Set;
-
-import net.sf.joafip.NotStorableClass;
-import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
-import net.sf.joafip.kvstore.service.HeapException;
-import net.sf.joafip.kvstore.service.IHeapDataManager;
-import net.sf.joafip.logger.JoafipLogger;
-
-/**
- *
- * @author luc peuvrier
- *
- */
-@NotStorableClass
-public abstract class AbstractHeapDataManager implements IHeapDataManager,
- Serializable {
-
- private static final String UNSUPPORTED_OPERATION = "unsupported operation";
-
- /**
- *
- */
- private static final long serialVersionUID = -2448517084972656682L;
-
- protected final JoafipLogger logger = JoafipLogger.getLogger(getClass());// NOPMD
-
- private static final String DATA_MANAGER_NOT_OPENED =
- /**/"data manager not opened";
-
- private static final String DATA_MANAGER_ALREADY_OPENED =
- /**/"data manager already opened";
-
- protected static final String FLUSH_FAILED =
- /**/"flush failed";
-
- protected static final String FAILED_READ_DATA_RECORD =
- /**/"failed read data record for identifier ";
-
- protected static final String CLEAR_STANDBY_MODIFICATION_FAILED =
- /**/"clear standby modification failed";
-
- /** true when this is service started state */
- private boolean started = false;
-
- private Exception stopperStackTrace = new Exception("stopper stack trace");// NOPMD
-
- private Exception starterStackTrace = null;
-
- @Override
- final public void startService(final boolean removeFiles)
- throws HeapException {
- try {
- // ASSERTX
- assert assertStopped();
- if (removeFiles) {
- removeFiles();
- if (logger.debugEnabled) {
- logger.debug("remove files");
- }
- }
- startServiceImpl(removeFiles);
- started = true;
- starterStackTrace = new Exception("starter stack trace");// NOPMD
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- /**
- * remove existing files
- *
- * @throws HeapException
- */
- protected abstract void removeFiles() throws HeapException;
-
- /**
- * to implement open actions
- *
- * @param removeFiles
- * @throws HeapException
- */
- protected abstract void startServiceImpl(final boolean removeFiles)
- throws HeapException;
-
- @Override
- final public void stopService() throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- started = false;
- stopperStackTrace = new Exception("stopper stack trace");// NOPMD
- stopServiceImpl();
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- /**
- * to implement close actions
- *
- * @throws HeapException
- */
- protected abstract void stopServiceImpl() throws HeapException;
-
- @Override
- public boolean isServiceStarted() {
- return started;
- }
-
- @Override
- public void clear() throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- clearImpl();
- if (logger.debugEnabled) {
- logger.debug("clear");
- }
- } catch (HeapException exception) {
- logger.fatal(CLEAR_STANDBY_MODIFICATION_FAILED);
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected abstract void clearImpl() throws HeapException;
-
- @Override
- public void flush() throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- flushImp();
- if (logger.debugEnabled) {
- logger.debug("flush");
- }
- } catch (HeapException exception) {
- logger.fatal(CLEAR_STANDBY_MODIFICATION_FAILED);
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- /**
- * implement all flush action after call to
- * {@link #updateHeapRecordImpl(DataRecordIdentifier, IHeapDataRecord)}
- *
- * @throws HeapException
- */
- protected abstract void flushImp() throws HeapException;
-
- @Override
- public void clearStandbyModification() throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- clearStandbyModificationImpl();
- if (logger.debugEnabled) {
- logger.debug("clear standby modification");
- }
- } catch (HeapException exception) {
- logger.fatal(CLEAR_STANDBY_MODIFICATION_FAILED);
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected abstract void clearStandbyModificationImpl() throws HeapException;
-
- @Override
- public DataRecordIdentifier getNextFreeDataRecordIdentifier()
- throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- return getNextFreeDataRecordIdentifierImpl();
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected abstract DataRecordIdentifier getNextFreeDataRecordIdentifierImpl()
- throws HeapException;
-
- @Override
- public void setNextFreeDataRecordIdentifier(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- setNextFreeDataRecordIdentifierImpl(dataRecordIdentifier);
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected abstract void setNextFreeDataRecordIdentifierImpl(
- DataRecordIdentifier dataRecordIdentifier) throws HeapException;
-
- @Override
- public DataRecordIdentifier getNewDataRecordIdentifier()
- throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- final DataRecordIdentifier newDataRecordIdentifier = getNewDataRecordIdentifierImpl();
- if (logger.debugEnabled) {
- logger.debug("new;" + newDataRecordIdentifier);
- }
- return newDataRecordIdentifier;
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- /**
- * to get a new data identifier for future data record creation<br>
- *
- * @return the new data record identifier
- * @throws HeapException
- */
- protected abstract DataRecordIdentifier getNewDataRecordIdentifierImpl()
- throws HeapException;
-
- @Override
- public boolean deleteDataRecord(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- final boolean deleted = deleteDataRecordImpl(dataRecordIdentifier);
- if (logger.debugEnabled) {
- logger.debug("delete;" + dataRecordIdentifier);
- }
- return deleted;
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected abstract boolean deleteDataRecordImpl(
- DataRecordIdentifier dataRecordIdentifier) throws HeapException;
-
- @Override
- public byte[] readDataRecord(final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- final byte[] data = readDataRecordImpl(dataRecordIdentifier);
- if (logger.debugEnabled) {
- logger.debug("read;" + dataRecordIdentifier + ";"
- + dataToString(data));
- }
- return data;
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected abstract byte[] readDataRecordImpl(
- DataRecordIdentifier dataRecordIdentifier) throws HeapException;
-
- @Override
- public boolean writeDataRecord(
- final DataRecordIdentifier dataRecordIdentifier, final byte[] data)
- throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- final boolean created = writeDataRecordImpl(dataRecordIdentifier,
- data);
- if (logger.debugEnabled) {
- logger.debug("write;" + dataRecordIdentifier + ";"
- + dataToString(data));
- }
- return created;
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- /**
- *
- * @param dataRecordIdentifier
- * @param data
- * @return true if data record created
- * @throws HeapException
- */
- protected abstract boolean writeDataRecordImpl(
- DataRecordIdentifier dataRecordIdentifier, byte[] data)
- throws HeapException;
-
- @Override
- public boolean hasDataRecord(final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- return hasDataRecordImpl(dataRecordIdentifier);
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected abstract boolean hasDataRecordImpl(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException;
-
- @Override
- public DataRecordIdentifier firstDataRecordIdentifier()
- throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- return firstDataRecordIdentifierImpl();
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected DataRecordIdentifier firstDataRecordIdentifierImpl()
- throws HeapException {
- throw new HeapException(UNSUPPORTED_OPERATION);
- }
-
- @Override
- public DataRecordIdentifier lastDataRecordIdentifier() throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- return lastDataRecordIdentifierImpl();
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected DataRecordIdentifier lastDataRecordIdentifierImpl()
- throws HeapException {
- throw new HeapException(UNSUPPORTED_OPERATION);
- }
-
- @Override
- public DataRecordIdentifier lowerDataRecordIdentifier(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- return lowerDataRecordIdentifierImpl(dataRecordIdentifier);
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected DataRecordIdentifier lowerDataRecordIdentifierImpl(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- throw new HeapException(UNSUPPORTED_OPERATION);
- }
-
- @Override
- public DataRecordIdentifier floorDataRecordIdentifier(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- return floorDataRecordIdentifierImpl(dataRecordIdentifier);
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected DataRecordIdentifier floorDataRecordIdentifierImpl(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- throw new HeapException(UNSUPPORTED_OPERATION);
- }
-
- @Override
- public DataRecordIdentifier ceilingDataRecordIdentifier(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- return ceilingDataRecordIdentifierImpl(dataRecordIdentifier);
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected DataRecordIdentifier ceilingDataRecordIdentifierImpl(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- throw new HeapException(UNSUPPORTED_OPERATION);
- }
-
- @Override
- public DataRecordIdentifier higherDataRecordIdentifier(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- return higherDataRecordIdentifierImpl(dataRecordIdentifier);
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected DataRecordIdentifier higherDataRecordIdentifierImpl(
- final DataRecordIdentifier dataRecordIdentifier)
- throws HeapException {
- throw new HeapException(UNSUPPORTED_OPERATION);
- }
-
- @Override
- public DataRecordIdentifier removeFirstDataRecord() throws HeapException {
- // ASSERTX
- try {
- assert assertStarted();
- return removeFirstDataRecordImpl();
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected abstract DataRecordIdentifier removeFirstDataRecordImpl()
- throws HeapException;
-
- @Override
- public int getNumberOfDataRecord() throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- return getNumberOfDataRecordImpl();
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- /**
- *
- * @return number of data record in heap file
- * @throws HeapException
- */
- protected abstract int getNumberOfDataRecordImpl() throws HeapException;
-
- @Override
- public int getNumberOfFreeRecord() throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- return getNumberOfFreeRecordImpl();
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected abstract int getNumberOfFreeRecordImpl() throws HeapException;
-
- @Override
- public long heapSize() throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- return heapSizeImpl();
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected abstract long heapSizeImpl() throws HeapException;
-
- @Override
- public long freeSize() throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- return freeSizeImpl();
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected abstract long freeSizeImpl() throws HeapException;
-
- @Override
- public long usedSize() throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- return usedSizeImpl();
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected abstract long usedSizeImpl() throws HeapException;
-
- @Override
- public Set<DataRecordIdentifier> getDataRecordIdentifierSet()
- throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- return getDataRecordIdentifierSetImpl();
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected abstract Set<DataRecordIdentifier> getDataRecordIdentifierSetImpl()
- throws HeapException;
-
- @Override
- public Iterator<DataRecordIdentifier> dataRecordIterator()
- throws HeapException {
- try {
- // ASSERTX
- assert assertStarted();
- return dataRecordIteratorImpl();
- } catch (HeapException exception) {
- closeHeapManagerAfterException();
- throw exception;
- } catch (RuntimeException exception) {
- closeHeapManagerAfterException();
- throw exception;
- }
- }
-
- protected abstract Iterator<DataRecordIdentifier> dataRecordIteratorImpl();
-
- /**
- * assert the data management service is started
- *
- * @throws HeapException
- */
- private boolean assertStarted() throws HeapException {
- if (!started) {
- if (logger.debugEnabled) {
- logger.debug("closer stack trace", stopperStackTrace);
- }
- throw new HeapException(DATA_MANAGER_NOT_OPENED, stopperStackTrace);
- }
- return true;
- }
-
- /**
- * assert the data management service is stopped
- *
- * @throws HeapException
- */
- private boolean assertStopped() throws HeapException {
- if (started) {
- if (logger.debugEnabled) {
- logger.debug("openner stack trace", starterStackTrace);
- }
- throw new HeapException(DATA_MANAGER_ALREADY_OPENED,
- starterStackTrace);
- }
- return true;
- }
-
- /**
- * close heap element manager after exception
- *
- */
- protected abstract void closeHeapManagerAfterException();
-
- private String dataToString(final byte data[]) {
- final StringBuilder builder = new StringBuilder();
- if (data != null) {
- for (byte byteValue : data) {
- builder.append(String.format("%02X", (int) byteValue));
- }
- }
- return builder.toString();
- }
-}
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-04-09 05:37:59 UTC (rev 2998)
+++ trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java 2012-04-09 05:41:25 UTC (rev 2999)
@@ -39,6 +39,7 @@
import net.sf.joafip.kvstore.entity.EnumFileState;
import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
import net.sf.joafip.kvstore.record.service.IDataRecordKeyManager;
+import net.sf.joafip.kvstore.service.AbstractHeapDataManager;
import net.sf.joafip.kvstore.service.HeapException;
import net.sf.joafip.redblacktree.entity.IRBTNode;
import net.sf.joafip.redblacktree.service.IRBTVisitor;
Modified: trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/BlockDataManager.java
===================================================================
--- trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/BlockDataManager.java 2012-04-09 05:37:59 UTC (rev 2998)
+++ trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/BlockDataManager.java 2012-04-09 05:41:25 UTC (rev 2999)
@@ -37,6 +37,7 @@
import net.sf.joafip.heapfile.entity.DataBlock;
import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
import net.sf.joafip.kvstore.record.service.IDataRecordKeyManager;
+import net.sf.joafip.kvstore.service.AbstractHeapDataManager;
import net.sf.joafip.kvstore.service.HeapException;
/**
Modified: trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/DualWrapDataManager.java
===================================================================
--- trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/DualWrapDataManager.java 2012-04-09 05:37:59 UTC (rev 2998)
+++ trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/DualWrapDataManager.java 2012-04-09 05:41:25 UTC (rev 2999)
@@ -373,7 +373,7 @@
@Override
public void setDataRecordKeyComparator(
- final IDataRecordKeyManager dataRecordKeyComparator) {
+ final IDataRecordKeyManager dataRecordKeyComparator) throws HeapException {
firstDataManager.setDataRecordKeyComparator(dataRecordKeyComparator);
secondDataManager.setDataRecordKeyComparator(dataRecordKeyComparator);
}
Modified: trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/HeapMemoryDataManagerMock.java
===================================================================
--- trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/HeapMemoryDataManagerMock.java 2012-04-09 05:37:59 UTC (rev 2998)
+++ trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/HeapMemoryDataManagerMock.java 2012-04-09 05:41:25 UTC (rev 2999)
@@ -28,6 +28,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
import net.sf.joafip.kvstore.record.service.IDataRecordKeyManager;
+import net.sf.joafip.kvstore.service.AbstractHeapDataManager;
import net.sf.joafip.kvstore.service.HeapException;
/**
Modified: trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/HeapMultiFileDataManager.java
===================================================================
--- trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/HeapMultiFileDataManager.java 2012-04-09 05:37:59 UTC (rev 2998)
+++ trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/HeapMultiFileDataManager.java 2012-04-09 05:41:25 UTC (rev 2999)
@@ -32,6 +32,7 @@
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.kvstore.record.entity.DataRecordIdentifier;
import net.sf.joafip.kvstore.record.service.IDataRecordKeyManager;
+import net.sf.joafip.kvstore.service.AbstractHeapDataManager;
import net.sf.joafip.kvstore.service.HeapException;
/**
Added: trunk/joafip-jdbm/.classpath
===================================================================
--- trunk/joafip-jdbm/.classpath (rev 0)
+++ trunk/joafip-jdbm/.classpath 2012-04-09 05:41:25 UTC (rev 2999)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: trunk/joafip-jdbm/.pmd
===================================================================
--- trunk/joafip-jdbm/.pmd (rev 0)
+++ trunk/joafip-jdbm/.pmd 2012-04-09 05:41:25 UTC (rev 2999)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pmd>
+ <useProjectRuleSet>true</useProjectRuleSet>
+ <ruleSetFile>C:\_DATA\java\eclipse\workspace\joafip-parent\pmd\.ruleset</ruleSetFile>
+ <includeDerivedFiles>false</includeDerivedFiles>
+ <violationsAsErrors>true</violationsAsErrors>
+</pmd>
Added: trunk/joafip-jdbm/.project
===================================================================
--- trunk/joafip-jdbm/.project (rev 0)
+++ trunk/joafip-jdbm/.project 2012-04-09 05:41:25 UTC (rev 2999)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>joafip-jdbm</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sourceforge.pmd.eclipse.plugin.pmdBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/joafip-jdbm/.ruleset
===================================================================
--- trunk/joafip-jdbm/.ruleset (rev 0)
+++ trunk/joafip-jdbm/.ruleset 2012-04-09 05:41:25 UTC (rev 2999)
@@ -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 ref="rulesets/design.xml/SingularField"/>
+ <rule ref="rulesets/design.xml/ReturnEmptyArrayRatherThanNull"/>
+ <rule ref="rulesets/design.xml/AbstractClassWithoutAnyMethod"/>
+ <rule ref="rulesets/design.xml/TooFewBranchesForASwitchStatement"/>
+</ruleset>
Added: trunk/joafip-jdbm/.settings/org.eclipse.core.resources.prefs
===================================================================
--- trunk/joafip-jdbm/.settings/org.eclipse.core.resources.prefs (rev 0)
+++ trunk/joafip-jdbm/.settings/org.eclipse.core.resources.prefs 2012-04-09 05:41:25 UTC (rev 2999)
@@ -0,0 +1,7 @@
+#Sun Apr 08 22:23:02 CEST 2012
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/main/resources=UTF-8
+encoding//src/test/java=UTF-8
+encoding//src/test/resources=UTF-8
+encoding/<project>=UTF-8
Added: trunk/joafip-jdbm/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/joafip-jdbm/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/joafip-jdbm/.settings/org.eclipse.jdt.core.prefs 2012-04-09 05:41:25 UTC (rev 2999)
@@ -0,0 +1,82 @@
+#Sun Apr 08 23:04:05 CEST 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/joafip-jdbm/.settings/org.eclipse.m2e.core.prefs
===================================================================
--- trunk/joafip-jdbm/.settings/org.eclipse.m2e.core.prefs (rev 0)
+++ trunk/joafip-jdbm/.settings/org.eclipse.m2e.core.prefs 2012-04-09 05:41:25 UTC (rev 2999)
@@ -0,0 +1,5 @@
+#Sun Apr 08 22:11:55 CEST 2012
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
Added: trunk/joafip-jdbm/pom.xml
===================================================================
--- trunk/joafip-jdbm/pom.xml (rev 0)
+++ trunk/joafip-jdbm/pom.xml 2012-04-09 05:41:25 UTC (rev 2999)
@@ -0,0 +1,57 @@
+<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>
+ <parent>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-parent</artifactId>
+ <version>1.0.0</version>
+ <relativePath>../joafip-parent</relativePath>
+ </parent>
+ <!-- <groupId>net.sf.joafip</groupId> -->
+ <artifactId>joafip-jdbm</artifactId>
+ <packaging>jar</packaging>
+ <version>4.0.0b8</version>
+ <url>http://joafip.sourceforge.net/</url>
+ <name>Joafip storage using jdbm</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>jdbm</groupId>
+ <artifactId>jdbm</artifactId>
+ <version>2.4</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-common</artifactId>
+ <version>4.0.0b8</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.joafip</groupId>
+ <artifactId>joafip-kvstore</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>
+
+ </dependencies>
+
+</project>
Added: trunk/joafip-jdbm/src/main/java/net/sf/joafip/jdbm/service/JdbmDataManager.java
===================================================================
--- trunk/joafip-jdbm/src/main/java/net/sf/joafip/jdbm/service/JdbmDataManager.java (rev 0)
+++ trunk/joafip-jdbm/src/main/java/net/sf/joafip/jdbm/service/JdbmDataManager.java 2012-04-09 05:41:25 UTC (rev 2999)
@@ -0,0 +1,289 @@
+/*
+ * 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.jdbm.service;
+
+import java.io.File;
+import java.util.Iterator;
+import java.util.Set;...
[truncated message content] |