Xuanwo commented on issue #7062:
URL: https://github.com/apache/opendal/issues/7062#issuecomment-3715523551

   > Would it make sense to have `content_length()` return `Option<u64>` in 
`Metadata` instead?
   
   I don't like this idea since users will need to check every content_length 
even when they are sure that the size exists. Sometimes they need to call 
`stat` on themselves.
   
   > I'm not sure this is the best approach. For services that don't include 
content-length in the list response, this could cause a noticeable performance 
regression. 
   
   I double check all the services with the help codex. Nearly all services 
support or can be configured to return the size during listing, with only the 
following exceptions.
   
   - redis (need extra call)
   - cloudflare-kv (nobody use it in fact, I prefer to remove it if it's the 
blocker)
   - ipfs (nobody use it in fact, I prefer to remove it if it's the blocker)
   - fs, compfs, opfs
   
   The only thing that matters to us is the local fs and redis.
   
   The questions on my mind are:
   
   - When users call `list`, what do they actually want? Can we assume that in 
90% of cases, they only want to know the size?
   - Is returning `Option<u64>` a good tradeoff just to satisfy two services?
   - Is an extra stat call to `fs` or `redis` a high cost?
   
   What's your answers to them?


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to