gortiz commented on code in PR #13907:
URL: https://github.com/apache/pinot/pull/13907#discussion_r1741001111


##########
pinot-spi/src/main/java/org/apache/pinot/spi/plugin/PluginsDirectoryVisitor.java:
##########
@@ -0,0 +1,45 @@
+package org.apache.pinot.spi.plugin;
+
+import java.io.IOException;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Path;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.Collection;
+import java.util.HashSet;
+
+
+class PluginsDirectoryVisitor extends SimpleFileVisitor<Path> {
+
+  private final Collection<Path> _pluginDirs = new HashSet<>();
+
+  private final PinotPluginHandler _pinotPluginHandler;
+
+  private final ShadedPluginHandler _shadedPluginHandler;
+
+  public PluginsDirectoryVisitor(PinotPluginHandler _pinotPluginHandler, 
ShadedPluginHandler _shadedPluginHandler) {
+    this._pinotPluginHandler = _pinotPluginHandler;
+    this._shadedPluginHandler = _shadedPluginHandler;
+  }
+
+  @Override
+  public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
+      throws IOException {
+    if(_pinotPluginHandler.isPluginDirectory(file) || 
_shadedPluginHandler.isPluginDirectory(file)) {
+      _pluginDirs.add(file);
+      return FileVisitResult.CONTINUE;
+    }
+
+    return super.visitFile(file, attrs);
+  }
+
+  @Override
+  public FileVisitResult visitFileFailed(Path file, IOException exc)
+      throws IOException {
+    return super.visitFileFailed(file, exc);
+  }

Review Comment:
   Why do we need to override this method?



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to