You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
1.2 KiB

  1. Design Assumptions:
  2. 1. the number of directories are magnitudely smaller than the number of files
  3. 2. unlimited number of files under any directories
  4. Phylosophy:
  5. metadata for directories and files should be separated
  6. Design:
  7. Store directories in normal map
  8. all of directories hopefully all be in memory
  9. efficient to move/rename/list_directories
  10. Log directory changes to append only log file
  11. Store files in sorted string table in <dir_id/filename> format
  12. efficient to list_files, just simple iterator
  13. efficient to locate files, binary search
  14. Testing:
  15. 1. starting server, "weed server -filer=true"
  16. 2. posting files to different folders
  17. curl -F "filename=@design.txt" "http://localhost:8888/sources/"
  18. curl -F "filename=@design.txt" "http://localhost:8888/design/"
  19. curl -F "filename=@directory.go" "http://localhost:8888/sources/weed/go/"
  20. curl -F "filename=@directory.go" "http://localhost:8888/sources/testing/go/"
  21. curl -F "filename=@filer.go" "http://localhost:8888/sources/weed/go/"
  22. curl -F "filename=@filer_in_leveldb.go" "http://localhost:8888/sources/weed/go/"
  23. curl "http://localhost:8888/?pretty=y"
  24. curl "http://localhost:8888/sources/weed/go/?pretty=y"
  25. curl "http://localhost:8888/sources/weed/go/?pretty=y"