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.

46 lines
1.3 KiB

  1. How to submit a content
  2. 1. Find physical volumes
  3. 1.c Create a hash value
  4. 1.d find a write logic volume id, and return [logic volume id, {physical volume ids}]
  5. 2. submit to physical volumes
  6. 2.c
  7. generate the cookie
  8. generate a unique id as key
  9. choose the right altKey
  10. send bytes to physical volumes
  11. 2.s each
  12. save bytes
  13. store map[key uint64, altKey uint32]<offset, size>
  14. for updated entry, set old entry's offset to zero
  15. 3.c
  16. wait for all physical volumes to finish
  17. store the /<logic volume id>/<key>_<cookie>_<altKey>.<ext>
  18. How to retrieve a content
  19. 1.c
  20. send logic volume id
  21. 1.d
  22. find least busy volume's id
  23. 2.c
  24. send URI /<physical volume id>/<key>_<cookie>_<altKey>.<ext>
  25. How to submit a content
  26. 1. send bytes to weedfs, got <volume id, key uint64, cookie code>
  27. store <key uint64, volume id uint32, cookie code uint32, ext>, and other information
  28. To read a content
  29. 2. use logic volume id to lookup a <machine id>
  30. render url as /<machine id>/<volume id>/<key>/<cookie>.ext
  31. The directory server
  32. 0.init
  33. load and collect <logic volume id, machine ids> mapping
  34. 1.on submit content
  35. find a free logic volume id, start sending content to 3 machines
  36. if all of them finishes, return <logic volume id, key, cookie code>
  37. 2.on read content
  38. based on logic volume id, pick a machine with less load,
  39. return <machine id>