You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by kr...@apache.org on 2011/09/02 09:28:45 UTC

svn commit: r1164380 - in /db/derby/code/branches/10.6: ./ java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java

Author: kristwaa
Date: Fri Sep  2 07:28:44 2011
New Revision: 1164380

URL: http://svn.apache.org/viewvc?rev=1164380&view=rev
Log:
DERBY-5393: Remove old in-memory database purge mechanism

Merged fix from trunk (revision 1164370).

Modified:
    db/derby/code/branches/10.6/   (props changed)
    db/derby/code/branches/10.6/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java

Propchange: db/derby/code/branches/10.6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 07:28:44 2011
@@ -1,3 +1,3 @@
 /db/derby/code/branches/10.7:1140196
-/db/derby/code/trunk:938547,938796,938959,939231,940462,940469,941627,942031,942286,942476,942480,942587,944152,946794,948045,948069,951346,951366,952138,952237,952581,954344,954421,954544,954748,955001,955540,955634,956075,956234,956445,956569,956659,957260,957902,958163,958257,958264,958508,958522,958555,958618,958939,959550,961892,962716,963206,963705,964039,964115,964402,965647,966393,967201,967304,980089,980684,986689,986834,987539,989099,990292,997325,998170,999119,999479,999485,1002291,1002682,1002853,1021426,1024511,1024528,1025615,1025795,1028716,1030043,1033485,1033864,1035164,1038514,1040658,1053724,1055169,1062096,1063809,1065061,1067250,1069661,1071886,1078461,1081455,1097247,1103681,1103718,1136363,1138341,1138444,1141924
+/db/derby/code/trunk:938547,938796,938959,939231,940462,940469,941627,942031,942286,942476,942480,942587,944152,946794,948045,948069,951346,951366,952138,952237,952581,954344,954421,954544,954748,955001,955540,955634,956075,956234,956445,956569,956659,957260,957902,958163,958257,958264,958508,958522,958555,958618,958939,959550,961892,962716,963206,963705,964039,964115,964402,965647,966393,967201,967304,980089,980684,986689,986834,987539,989099,990292,997325,998170,999119,999479,999485,1002291,1002682,1002853,1021426,1024511,1024528,1025615,1025795,1028716,1030043,1033485,1033864,1035164,1038514,1040658,1053724,1055169,1062096,1063809,1065061,1067250,1069661,1071886,1078461,1081455,1097247,1103681,1103718,1136363,1138341,1138444,1141924,1164370
 /db/derby/docs/trunk:954344

Modified: db/derby/code/branches/10.6/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java?rev=1164380&r1=1164379&r2=1164380&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java (original)
+++ db/derby/code/branches/10.6/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java Fri Sep  2 07:28:44 2011
@@ -63,26 +63,6 @@ public class VFMemoryStorageFactory
      */
     private static final DataStore DUMMY_STORE = new DataStore("::DUMMY::");
 
-    /**
-     * TODO: Remove this method once the new mechanism has been added.
-     * Deletes the database if it exists.
-     *
-     * @param dbName the database name
-     * @return {@code true} if the database was deleted, {@code false} otherwise
-     */
-    public static boolean purgeDatabase(final String dbName) {
-        // TODO: Should we check if the database is booted / active?
-        synchronized (DATABASES) {
-            DataStore store = (DataStore)DATABASES.remove(dbName);
-            if (store != null) {
-                // Delete everything.
-                store.purge();
-                return true;
-            }
-            return false;
-        }
-    }
-
     /** The canonical (unique) name of the database (absolute path). */
     private String canonicalName;
     /** The data directory of the database. */
@@ -329,7 +309,6 @@ public class VFMemoryStorageFactory
      */
     public void sync(OutputStream stream, boolean metaData) {
         // Does nothing, data is stored only in memory.
-        // TODO: Are there any streams that needs to be flushed?
     }
 
     public boolean supportsWriteSync() {
@@ -347,7 +326,7 @@ public class VFMemoryStorageFactory
      * @throws NullPointerException if {@code file} is {@code null}
      */
     private String normalizePath(String dir, String file) {
-        if (dir == null || dir.equals("")) {
+        if (dir == null || dir.length() == 0) {
             dir = dataDirectory.getPath();
         } else if (!new File(dir).isAbsolute()) {
             dir = new File(dataDirectory.getPath(), dir).getPath();
@@ -364,7 +343,7 @@ public class VFMemoryStorageFactory
      * @return A path.
      */
     private String normalizePath(String path) {
-        if (path == null || path.equals("")) {
+        if (path == null || path.length() == 0) {
             return dataDirectory.getPath();
         } else if (new File(path).isAbsolute()) {
             return path;