lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject svn commit: r1672641 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/core/ solr/core/src/java/org/apache/solr/handler/ solr/core/src/test/org/apache/solr/handler/
Date Fri, 10 Apr 2015 13:07:49 GMT
Author: varun
Date: Fri Apr 10 13:07:49 2015
New Revision: 1672641

URL: http://svn.apache.org/r1672641
Log:
SOLR-6637: can't assume a local filesystem when dealing with paths (merged from trunk r1672620)

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/RestoreCore.java
    lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
    lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java?rev=1672641&r1=1672640&r2=1672641&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
Fri Apr 10 13:07:49 2015
@@ -357,7 +357,7 @@ public class IndexFetcher {
           || commit.getGeneration() >= latestGeneration || forceReplication;
 
       String tmpIdxDirName = "index." + new SimpleDateFormat(SnapShooter.DATE_FMT, Locale.ROOT).format(new
Date());
-      tmpIndex = Paths.get(solrCore.getDataDir(), tmpIdxDirName).toString();
+      tmpIndex = solrCore.getDataDir() + tmpIdxDirName;
 
       tmpIndexDir = solrCore.getDirectoryFactory().get(tmpIndex, DirContext.DEFAULT, solrCore.getSolrConfig().indexConfig.lockType);
       

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/RestoreCore.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/RestoreCore.java?rev=1672641&r1=1672640&r2=1672641&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/RestoreCore.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/RestoreCore.java
Fri Apr 10 13:07:49 2015
@@ -56,9 +56,9 @@ public class RestoreCore implements Call
 
   private boolean doRestore() throws Exception {
 
-    Path backupPath = Paths.get(backupLocation, backupName);
+    Path backupPath = Paths.get(backupLocation).resolve(backupName);
     String restoreIndexName = "restore." + backupName;
-    Path restoreIndexPath = Paths.get(core.getDataDir(), restoreIndexName);
+    String restoreIndexPath = core.getDataDir() + restoreIndexName;
 
     Directory restoreIndexDir = null;
     Directory indexDir = null;
@@ -66,7 +66,7 @@ public class RestoreCore implements Call
 
       final Version version = IndexFetcher.checkOldestVersion(SegmentInfos.readLatestCommit(backupDir));
 
-      restoreIndexDir = core.getDirectoryFactory().get(restoreIndexPath.toString(),
+      restoreIndexDir = core.getDirectoryFactory().get(restoreIndexPath,
           DirectoryFactory.DirContext.DEFAULT, core.getSolrConfig().indexConfig.lockType);
 
       //Prefer local copy.

Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java?rev=1672641&r1=1672640&r2=1672641&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
Fri Apr 10 13:07:49 2015
@@ -1274,7 +1274,7 @@ public class TestReplicationHandler exte
     masterClient.close();
     masterJetty.stop();
 
-    Directory dir = FSDirectory.open(Paths.get(dataDir, "index"));
+    Directory dir = FSDirectory.open(Paths.get(dataDir).resolve("index"));
     String[] files = dir.listAll();
     long totalBytes = 0;
     for(String file : files) {

Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java?rev=1672641&r1=1672640&r2=1672641&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java
Fri Apr 10 13:07:49 2015
@@ -186,7 +186,7 @@ public class TestRestoreCore extends Sol
 
     //Remove the segments_n file so that the backup index is corrupted.
     //Restore should fail and it should automatically rollback to the original index.
-    Path restoreIndexPath = Paths.get(location, "snapshot." + snapshotName);
+    Path restoreIndexPath = Paths.get(location).resolve("snapshot." + snapshotName);
     try (DirectoryStream<Path> stream = Files.newDirectoryStream(restoreIndexPath,
IndexFileNames.SEGMENTS + "*")) {
       Path segmentFileName = stream.iterator().next();
       Files.delete(segmentFileName);



Mime
View raw message