lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1458032 - in /lucene/dev/branches/lucene_solr_4_2: ./ solr/ solr/core/ solr/core/src/java/org/apache/solr/core/ solr/core/src/java/org/apache/solr/handler/ solr/core/src/test/org/apache/solr/core/ solr/core/src/test/org/apache/solr/handler...
Date Mon, 18 Mar 2013 22:01:06 GMT
Author: markrmiller
Date: Mon Mar 18 22:01:05 2013
New Revision: 1458032

URL: http://svn.apache.org/r1458032
Log:
SOLR-4475: Fix various places that still assume File based paths even when not using a file
based DirectoryFactory.
SOLR-4551: CachingDirectoryFactory needs to create CacheEntry's with the fullpath not path.

Modified:
    lucene/dev/branches/lucene_solr_4_2/   (props changed)
    lucene/dev/branches/lucene_solr_4_2/solr/   (props changed)
    lucene/dev/branches/lucene_solr_4_2/solr/CHANGES.txt
    lucene/dev/branches/lucene_solr_4_2/solr/build.xml   (contents, props changed)
    lucene/dev/branches/lucene_solr_4_2/solr/core/   (props changed)
    lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java
    lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/CoreDescriptor.java
    lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java
    lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/EphemeralDirectoryFactory.java
    lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/MMapDirectoryFactory.java
    lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/NIOFSDirectoryFactory.java
    lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java
    lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/SimpleFSDirectoryFactory.java
    lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/SolrCore.java
    lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/StandardDirectoryFactory.java
    lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/handler/SnapPuller.java
    lucene/dev/branches/lucene_solr_4_2/solr/core/src/test/org/apache/solr/core/AlternateDirectoryTest.java
    lucene/dev/branches/lucene_solr_4_2/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
    lucene/dev/branches/lucene_solr_4_2/solr/test-framework/   (props changed)
    lucene/dev/branches/lucene_solr_4_2/solr/test-framework/src/java/org/apache/solr/core/MockDirectoryFactory.java
    lucene/dev/branches/lucene_solr_4_2/solr/test-framework/src/java/org/apache/solr/core/MockFSDirectoryFactory.java

Modified: lucene/dev/branches/lucene_solr_4_2/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/CHANGES.txt?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/CHANGES.txt (original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/CHANGES.txt Mon Mar 18 22:01:05 2013
@@ -39,6 +39,12 @@ Bug Fixes
 * SOLR-4567: copyField source glob matching explicit field(s) stopped working
   in Solr 4.2. (Alexandre Rafalovitch, Steve Rowe)
 
+* SOLR-4475: Fix various places that still assume File based paths even when 
+  not using a file based DirectoryFactory. (Mark Miller)
+  
+* SOLR-4551: CachingDirectoryFactory needs to create CacheEntry's with the 
+  fullpath not path. (Mark Miller)
+
 Other Changes
 ----------------------
 

Modified: lucene/dev/branches/lucene_solr_4_2/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/build.xml?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/build.xml (original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/build.xml Mon Mar 18 22:01:05 2013
@@ -70,7 +70,7 @@
     <java jar="${example}/start.jar" fork="true" dir="${example}" maxmemory="${example.heap.size}">
       <jvmarg line="${example.jvm.line}"/>
       <sysproperty key="solr.solr.home" file="${example.solr.home}"/>
-      <sysproperty key="solr.data.dir" file="${example.data.dir}"/>
+      <sysproperty key="solr.data.dir" value="${example.data.dir}"/>
       <sysproperty key="jetty.port" value="${example.jetty.port}"/>
     </java>
   </target>

Modified: lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java
Mon Mar 18 22:01:05 2013
@@ -204,7 +204,7 @@ public abstract class CachingDirectoryFa
   protected abstract Directory create(String path, DirContext dirContext) throws IOException;
   
   @Override
-  public boolean exists(String path) {
+  public boolean exists(String path) throws IOException {
     // back compat behavior
     File dirFile = new File(path);
     return dirFile.canRead() && dirFile.list().length > 0;
@@ -231,7 +231,7 @@ public abstract class CachingDirectoryFa
   @Override
   public final Directory get(String path,  DirContext dirContext, String rawLockType, boolean
forceNew)
       throws IOException {
-    String fullPath = new File(path).getAbsolutePath();
+    String fullPath = normalize(path);
     synchronized (this) {
       if (closed) {
         throw new RuntimeException("Already closed");
@@ -271,7 +271,7 @@ public abstract class CachingDirectoryFa
         newCacheValue.directory = directory;
         newCacheValue.path = fullPath;
         
-        injectLockFactory(directory, path, rawLockType);
+        injectLockFactory(directory, fullPath, rawLockType);
         
         byDirectoryCache.put(directory, newCacheValue);
         byPathCache.put(fullPath, newCacheValue);
@@ -372,4 +372,11 @@ public abstract class CachingDirectoryFa
     }
     return dir;
   }
+  
+  protected String stripTrailingSlash(String path) {
+    if (path.endsWith("/")) {
+      path = path.substring(0, path.length() - 1);
+    }
+    return path;
+  }
 }

Modified: lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/CoreDescriptor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/CoreDescriptor.java?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/CoreDescriptor.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/CoreDescriptor.java
Mon Mar 18 22:01:05 2013
@@ -111,16 +111,7 @@ public class CoreDescriptor {
   public String getDataDir() {
     String dataDir = this.dataDir;
     if (dataDir == null) dataDir = getDefaultDataDir();
-    if (new File(dataDir).isAbsolute()) {
-      return dataDir;
-    } else {
-      if (new File(instanceDir).isAbsolute()) {
-        return SolrResourceLoader.normalizeDir(SolrResourceLoader.normalizeDir(instanceDir)
+ dataDir);
-      } else  {
-        return SolrResourceLoader.normalizeDir(coreContainer.getSolrHome() +
-                SolrResourceLoader.normalizeDir(instanceDir) + dataDir);
-      }
-    }
+    return dataDir;
   }
 
   public void setDataDir(String s) {

Modified: lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java
Mon Mar 18 22:01:05 2013
@@ -18,6 +18,7 @@ package org.apache.solr.core;
  */
 
 import java.io.Closeable;
+import java.io.File;
 import java.io.IOException;
 
 import org.apache.lucene.store.Directory;
@@ -77,9 +78,10 @@ public abstract class DirectoryFactory i
   
   /**
    * Returns true if a Directory exists for a given path.
+   * @throws IOException If there is a low-level I/O error.
    * 
    */
-  public abstract boolean exists(String path);
+  public abstract boolean exists(String path) throws IOException;
   
   /**
    * Removes the Directory's persistent storage.
@@ -172,6 +174,15 @@ public abstract class DirectoryFactory i
     return path;
   }
   
+  /**
+   * @param path the path to check
+   * @return true if absolute, as in not relative
+   */
+  public boolean isAbsolute(String path) {
+    // back compat
+    return new File(path).isAbsolute();
+  }
+  
   public static long sizeOfDirectory(Directory directory) throws IOException {
     final String[] files = directory.listAll();
     long size = 0;

Modified: lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/EphemeralDirectoryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/EphemeralDirectoryFactory.java?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/EphemeralDirectoryFactory.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/EphemeralDirectoryFactory.java
Mon Mar 18 22:01:05 2013
@@ -16,7 +16,6 @@ package org.apache.solr.core;
  * limitations under the License.
  */
 
-import java.io.File;
 import java.io.IOException;
 
 import org.apache.lucene.store.Directory;
@@ -28,8 +27,8 @@ import org.apache.lucene.store.Directory
 public abstract class EphemeralDirectoryFactory extends CachingDirectoryFactory {
   
   @Override
-  public boolean exists(String path) {
-    String fullPath = new File(path).getAbsolutePath();
+  public boolean exists(String path) throws IOException {
+    String fullPath = normalize(path);
     synchronized (this) {
       CacheValue cacheValue = byPathCache.get(fullPath);
       Directory directory = null;
@@ -49,6 +48,12 @@ public abstract class EphemeralDirectory
   }
   
   @Override
+  public boolean isAbsolute(String path) {
+    return true;
+  }
+  
+  
+  @Override
   public void remove(Directory dir) throws IOException {
     // ram dir does not persist its dir anywhere
   }
@@ -60,6 +65,7 @@ public abstract class EphemeralDirectory
   
   @Override
   public String normalize(String path) throws IOException {
+    path = stripTrailingSlash(path);
     return path;
   }
 }

Modified: lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/MMapDirectoryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/MMapDirectoryFactory.java?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/MMapDirectoryFactory.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/MMapDirectoryFactory.java
Mon Mar 18 22:01:05 2013
@@ -66,4 +66,9 @@ public class MMapDirectoryFactory extend
     }
     return mapDirectory;
   }
+  
+  @Override
+  public boolean isAbsolute(String path) {
+    return new File(path).isAbsolute();
+  }
 }

Modified: lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/NIOFSDirectoryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/NIOFSDirectoryFactory.java?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/NIOFSDirectoryFactory.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/NIOFSDirectoryFactory.java
Mon Mar 18 22:01:05 2013
@@ -16,13 +16,12 @@ package org.apache.solr.core;
  * limitations under the License.
  */
 
-import org.apache.lucene.store.Directory;
-import org.apache.lucene.store.NIOFSDirectory;
-import org.apache.solr.core.DirectoryFactory.DirContext;
-
 import java.io.File;
 import java.io.IOException;
 
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.NIOFSDirectory;
+
 
 /**
  * Factory to instantiate {@link org.apache.lucene.store.NIOFSDirectory}
@@ -35,4 +34,9 @@ public class NIOFSDirectoryFactory exten
     return new NIOFSDirectory(new File(path));
   }
   
+  @Override
+  public boolean isAbsolute(String path) {
+    return new File(path).isAbsolute();
+  }
+  
 }

Modified: lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java
Mon Mar 18 22:01:05 2013
@@ -54,5 +54,10 @@ public class NRTCachingDirectoryFactory 
   protected Directory create(String path, DirContext dirContext) throws IOException {
     return new NRTCachingDirectory(FSDirectory.open(new File(path)), maxMergeSizeMB, maxCachedMB);
   }
+  
+  @Override
+  public boolean isAbsolute(String path) {
+    return new File(path).isAbsolute();
+  }
 
 }

Modified: lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/SimpleFSDirectoryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/SimpleFSDirectoryFactory.java?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/SimpleFSDirectoryFactory.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/SimpleFSDirectoryFactory.java
Mon Mar 18 22:01:05 2013
@@ -16,13 +16,12 @@ package org.apache.solr.core;
  * limitations under the License.
  */
 
-import org.apache.lucene.store.Directory;
-import org.apache.lucene.store.SimpleFSDirectory;
-import org.apache.solr.core.DirectoryFactory.DirContext;
-
 import java.io.File;
 import java.io.IOException;
 
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.SimpleFSDirectory;
+
 
 /**
  * Factory to instantiate {@link org.apache.lucene.store.SimpleFSDirectory}
@@ -35,4 +34,8 @@ public class SimpleFSDirectoryFactory ex
     return new SimpleFSDirectory(new File(path));
   }
 
+  @Override
+  public boolean isAbsolute(String path) {
+    return new File(path).isAbsolute();
+  }
 }

Modified: lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/SolrCore.java?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/SolrCore.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/SolrCore.java
Mon Mar 18 22:01:05 2013
@@ -459,7 +459,7 @@ public final class SolrCore implements S
       boolean indexExists = getDirectoryFactory().exists(indexDir);
       boolean firstTime;
       synchronized (SolrCore.class) {
-        firstTime = dirs.add(new File(indexDir).getCanonicalPath());
+        firstTime = dirs.add(getDirectoryFactory().normalize(indexDir));
       }
       boolean removeLocks = solrConfig.unlockOnStartup;
 
@@ -656,11 +656,27 @@ public final class SolrCore implements S
     coreDescriptor = cd;
     this.setName( name );
     resourceLoader = config.getResourceLoader();
-    if (dataDir == null){
-      if(cd.usingDefaultDataDir()) dataDir = config.getDataDir();
-      if(dataDir == null) dataDir = cd.getDataDir();
-    }
 
+    this.solrConfig = config;
+    
+    if (updateHandler == null) {
+      initDirectoryFactory();
+    }
+    
+    if (dataDir == null) {
+      if (cd.usingDefaultDataDir()) dataDir = config.getDataDir();
+      if (dataDir == null) {
+        dataDir = cd.getDataDir();
+        try {
+          if (!directoryFactory.isAbsolute(dataDir)) {
+            dataDir = directoryFactory.normalize(SolrResourceLoader
+                .normalizeDir(cd.getInstanceDir()) + dataDir);
+          }
+        } catch (IOException e) {
+          throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, null, e);
+        }
+      }
+    }
     dataDir = SolrResourceLoader.normalizeDir(dataDir);
 
     log.info(logid+"Opening new SolrCore at " + resourceLoader.getInstanceDir() + ", dataDir="+dataDir);
@@ -700,7 +716,6 @@ public final class SolrCore implements S
 
     this.schema = schema;
     this.dataDir = dataDir;
-    this.solrConfig = config;
     this.startTime = System.currentTimeMillis();
     this.maxWarmingSearchers = config.maxWarmingSearchers;
 

Modified: lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/StandardDirectoryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/StandardDirectoryFactory.java?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/StandardDirectoryFactory.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/core/StandardDirectoryFactory.java
Mon Mar 18 22:01:05 2013
@@ -43,7 +43,9 @@ public class StandardDirectoryFactory ex
   
   @Override
   public String normalize(String path) throws IOException {
-    return new File(path).getCanonicalPath();
+    String cpath = new File(path).getCanonicalPath();
+    
+    return stripTrailingSlash(cpath);
   }
   
   public boolean isPersistent() {
@@ -51,6 +53,12 @@ public class StandardDirectoryFactory ex
   }
   
   @Override
+  public boolean isAbsolute(String path) {
+    // back compat
+    return new File(path).isAbsolute();
+  }
+  
+  @Override
   public void remove(Directory dir) throws IOException {
     CacheValue val = byDirectoryCache.get(dir);
     if (val == null) {
@@ -59,11 +67,10 @@ public class StandardDirectoryFactory ex
     File dirFile = new File(val.path);
     FileUtils.deleteDirectory(dirFile);
   }
-  
 
   @Override
   public void remove(String path) throws IOException {
-    String fullPath = new File(path).getAbsolutePath();
+    String fullPath = normalize(path);
     File dirFile = new File(fullPath);
     FileUtils.deleteDirectory(dirFile);
   }

Modified: lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/handler/SnapPuller.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/handler/SnapPuller.java?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/handler/SnapPuller.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/handler/SnapPuller.java
Mon Mar 18 22:01:05 2013
@@ -439,8 +439,12 @@ public class SnapPuller {
             @Override
             public void preClose() {
               LOG.info("removing old index files " + freezeIndexDir);
-              if (core.getDirectoryFactory().exists(freezeIndexDirPath)) {
-                DirectoryFactory.empty(freezeIndexDir);
+              try {
+                if (core.getDirectoryFactory().exists(freezeIndexDirPath)) {
+                  DirectoryFactory.empty(freezeIndexDir);
+                }
+              } catch (IOException e) {
+                SolrException.log(LOG, null, e);
               }
             }
             
@@ -674,13 +678,14 @@ public class SnapPuller {
     
   }
 
-
   /**
    * All the files are copied to a temp dir first
    */
   private String createTempindexDir(SolrCore core, String tmpIdxDirName) {
-    File tmpIdxDir = new File(core.getDataDir(), tmpIdxDirName);
-    return tmpIdxDir.toString();
+    // TODO: there should probably be a DirectoryFactory#concatPath(parent, name)
+    // or something
+    String tmpIdxDir = core.getDataDir() + tmpIdxDirName;
+    return tmpIdxDir;
   }
 
   private void reloadCore() {

Modified: lucene/dev/branches/lucene_solr_4_2/solr/core/src/test/org/apache/solr/core/AlternateDirectoryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/core/src/test/org/apache/solr/core/AlternateDirectoryTest.java?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/core/src/test/org/apache/solr/core/AlternateDirectoryTest.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/core/src/test/org/apache/solr/core/AlternateDirectoryTest.java
Mon Mar 18 22:01:05 2013
@@ -22,7 +22,6 @@ import java.io.IOException;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.store.Directory;
 import org.apache.solr.SolrTestCaseJ4;
-import org.apache.solr.core.DirectoryFactory.DirContext;
 import org.junit.BeforeClass;
 import org.junit.Test;
 

Modified: lucene/dev/branches/lucene_solr_4_2/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
Mon Mar 18 22:01:05 2013
@@ -71,7 +71,7 @@ import org.junit.Test;
 public class TestReplicationHandler extends SolrTestCaseJ4 {
 
 
-  private static final String CONF_DIR = "." + File.separator + "solr"
+  private static final String CONF_DIR = "solr"
       + File.separator + "collection1" + File.separator + "conf"
       + File.separator;
 

Modified: lucene/dev/branches/lucene_solr_4_2/solr/test-framework/src/java/org/apache/solr/core/MockDirectoryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/test-framework/src/java/org/apache/solr/core/MockDirectoryFactory.java?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/test-framework/src/java/org/apache/solr/core/MockDirectoryFactory.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/test-framework/src/java/org/apache/solr/core/MockDirectoryFactory.java
Mon Mar 18 22:01:05 2013
@@ -17,6 +17,7 @@ package org.apache.solr.core;
  * limitations under the License.
  */
 
+import java.io.File;
 import java.io.IOException;
 
 import org.apache.lucene.store.Directory;
@@ -54,5 +55,12 @@ public class MockDirectoryFactory extend
     
     return dir;
   }
+  
+  @Override
+  public boolean isAbsolute(String path) {
+    // TODO: kind of a hack - we don't know what the delegate is, so
+    // we treat it as file based since this works on most ephem impls
+    return new File(path).isAbsolute();
+  }
 
 }

Modified: lucene/dev/branches/lucene_solr_4_2/solr/test-framework/src/java/org/apache/solr/core/MockFSDirectoryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/test-framework/src/java/org/apache/solr/core/MockFSDirectoryFactory.java?rev=1458032&r1=1458031&r2=1458032&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/test-framework/src/java/org/apache/solr/core/MockFSDirectoryFactory.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/test-framework/src/java/org/apache/solr/core/MockFSDirectoryFactory.java
Mon Mar 18 22:01:05 2013
@@ -43,4 +43,11 @@ public class MockFSDirectoryFactory exte
     }
     return dir;
   }
+  
+  @Override
+  public boolean isAbsolute(String path) {
+    // TODO: kind of a hack - we don't know what the delegate is, so
+    // we treat it as file based since this works on most ephem impls
+    return new File(path).isAbsolute();
+  }
 }



Mime
View raw message