You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2021/03/17 18:55:18 UTC

[GitHub] [solr] madrob commented on a change in pull request #10: SOLR-15244 Switch File to Path

madrob commented on a change in pull request #10:
URL: https://github.com/apache/solr/pull/10#discussion_r596299172



##########
File path: solr/solrj/src/java/org/apache/solr/common/cloud/PerReplicaStatesOps.java
##########
@@ -65,13 +65,7 @@ private void persist(List<PerReplicaStates.Operation> operations, String znode,
                     Op.create(path, null, zkClient.getZkACLProvider().getACLsToAdd(path), CreateMode.PERSISTENT) :
                     Op.delete(path, -1));
         }
-        try {
-            zkClient.multi(ops, true);
-        } catch (KeeperException e) {
-          log.error("Multi-op exception: {}", zkClient.getChildren(znode, null, true));
-          throw e;
-        }
-
+        zkClient.multi(ops, true);

Review comment:
       this snuck in and shouldn't be here, will remove before next iteration.

##########
File path: solr/core/src/java/org/apache/solr/core/snapshots/SolrSnapshotsTool.java
##########
@@ -226,10 +226,9 @@ public void describeSnapshot(String collectionName, String snapshotName) {
       }
 
       String indexDirPath = coreSnap.getIndexDirPath();
-      if (pathPrefix.isPresent()) {
+      if (pathPrefix != null) {
         // If the path prefix is specified, rebuild the path to the index directory.
-        Path t = new Path(coreSnap.getIndexDirPath());
-        indexDirPath = (new Path(pathPrefix.get(), t.toUri().getPath())).toString();
+        indexDirPath = new Path(pathPrefix, coreSnap.getIndexDirPath()).toString();

Review comment:
       Oh, uh, I didn't even notice. Thanks for pointing this out, I'll take a closer look.

##########
File path: solr/core/src/java/org/apache/solr/core/MMapDirectoryFactory.java
##########
@@ -61,8 +60,7 @@ public void init(NamedList args) {
 
   @Override
   protected Directory create(String path, LockFactory lockFactory, DirContext dirContext) throws IOException {
-    // we pass NoLockFactory, because the real lock factory is set later by injectLockFactory:

Review comment:
       yes

##########
File path: solr/core/src/java/org/apache/solr/core/snapshots/SolrSnapshotsTool.java
##########
@@ -226,10 +226,9 @@ public void describeSnapshot(String collectionName, String snapshotName) {
       }
 
       String indexDirPath = coreSnap.getIndexDirPath();
-      if (pathPrefix.isPresent()) {
+      if (pathPrefix != null) {
         // If the path prefix is specified, rebuild the path to the index directory.
-        Path t = new Path(coreSnap.getIndexDirPath());
-        indexDirPath = (new Path(pathPrefix.get(), t.toUri().getPath())).toString();
+        indexDirPath = new Path(pathPrefix, coreSnap.getIndexDirPath()).toString();

Review comment:
       Yea, this change is still fine, the old code is doing a bunch of extra conversions between Hadoop Path, URI, and String, and back and forth.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org