bruno-roustant commented on a change in pull request #108:
URL: https://github.com/apache/solr/pull/108#discussion_r650926535



##########
File path: 
solr/contrib/blob-directory/src/java/org/apache/solr/blob/BlobStoreConnection.java
##########
@@ -152,11 +180,66 @@ private void createDirectories(URI blobDirUri, String 
blobDirPath) throws IOExce
     }
   }
 
+  private void copyStream(IndexInput input, OutputStream output) throws 
IOException {
+    byte[] buffer = streamBuffers.get();
+    long remaining = input.length();
+    while (remaining > 0) {
+      int length = (int) Math.min(buffer.length, remaining);
+      input.readBytes(buffer, 0, length, false);
+      output.write(buffer, 0, length);
+      remaining -= length;
+    }
+  }
+
   private void deleteFiles(String blobDirPath, Collection<String> fileNames) 
throws IOException {
     URI blobDirUri = repository.resolve(repositoryLocation, blobDirPath);
     repository.delete(blobDirUri, fileNames, true);
   }
 
+  /**
+   * Lists the files in a specific directory of the repository and select them 
with the provided filter.
+   */
+  private List<BlobFile> list(URI blobDirUri, BlobFileFilter fileFilter) 
throws IOException {
+    String[] fileNames = repository.listAll(blobDirUri);
+    List<BlobFile> blobFiles = new ArrayList<>(fileNames.length);
+    for (String fileName : fileNames) {
+      BlobFile blobFile = new BlobFile(fileName, -1, -1);
+      if (fileFilter.accept(blobFile)) {
+        blobFiles.add(blobFile);
+      }
+    }
+    return blobFiles;
+  }
+
+  private List<Callable<Void>> pullFiles(

Review comment:
       I prefer to keep pullFiles() to be consistent with pushFiles() and 
executeAll().




-- 
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:
us...@infra.apache.org



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

Reply via email to