Skip to content

Commit

Permalink
feat!: Improve file attribute caching (#854)
Browse files Browse the repository at this point in the history
Set the default cache size to 30k
  • Loading branch information
steve-todorov committed Nov 7, 2024
1 parent 7cc3d79 commit e03a486
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public abstract class S3Factory
* Total size of {@link S3BasicFileAttributes} and {@link S3PosixFileAttributes} cache.
*/
public static final String CACHE_ATTRIBUTES_SIZE = "s3fs.cache.attributes.size";
public static final int CACHE_ATTRIBUTES_SIZE_DEFAULT = 5000;
public static final int CACHE_ATTRIBUTES_SIZE_DEFAULT = 30000;

public static final String REQUEST_METRIC_COLLECTOR_CLASS = "s3fs.request.metric.collector.class";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ void testScenario002() throws IOException
long startTime = System.currentTimeMillis();
AtomicInteger processedFileCount = new AtomicInteger(0);

// Reminder: The `.limit()` will not limit the amount of requests sent to AWS.
// If the rootPath contains 100k files and the `.limit(1000)` -- it will still fetch the 100k files first.
try (Stream<Path> stream = Files.list(rootPath).limit(totalFilesAdded.get()))
{
stream.filter(path -> path != null &&
Expand Down

0 comments on commit e03a486

Please sign in to comment.