[Extra] swift-client list container command makes unnecessary REST calls

Bug #1561021 reported by Marc-Alexander Jäger
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sahara
Confirmed
High
Unassigned

Bug Description

Hi,

The "listContainer()" equivalent call in the sahara swift-client makes unnecessary REST calls for each object found in the container which makes it very slow the more files there are in the container. Possible fix in the SwiftNativeFileSystemStore class would be something like:

diff --git a/hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/snative/SwiftNativeFileSystemStore.java b/hadoop-swiftfs/src/main/ja
index c2d4f49..b9b08a7 100644
--- a/hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/snative/SwiftNativeFileSystemStore.java
+++ b/hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/snative/SwiftNativeFileSystemStore.java
@@ -556,7 +556,9 @@ public class SwiftNativeFileSystemStore {

       if (!name.endsWith("/")) {
         final Path filePath = getCorrectSwiftPath(new Path(name));
- files.add(getObjectMetadata(filePath, newest));
+ files.add(
+ new SwiftFileStatus(status.getBytes(), false, 0, 1l,
+ status.getLast_modified().getTime(), filePath));
         prevObjName = name;
       } else {
         if (prevObjName.length() + 1 == name.length() &&

Best regards
Marc

description: updated
summary: - Sahra-extra swift-client list container command (e.g. hdfs dfs -ls)
- makes unnecessary REST calls
+ [Extra] swift-client list container command (e.g. hdfs dfs -ls) makes
+ unnecessary REST calls
summary: - [Extra] swift-client list container command (e.g. hdfs dfs -ls) makes
- unnecessary REST calls
+ [Extra] swift-client list container command makes unnecessary REST calls
Changed in sahara:
importance: Undecided → High
milestone: none → newton-1
status: New → Confirmed
Revision history for this message
Marc-Alexander Jäger (marc-alexander-jaeger) wrote :

I am not sure if pseudo directories should be handled separately. I'am working on that as well.

Changed in sahara:
milestone: newton-1 → newton-2
Changed in sahara:
milestone: newton-2 → none
tags: added: hadoop.swift.lib
Changed in sahara:
milestone: none → next
Changed in sahara:
milestone: next → none
Luigi Toscano (ltoscano)
tags: added: sahara-extra
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.