All of lore.kernel.org
 help / color / mirror / Atom feed
* libcephfs create file with layout and replication
@ 2012-11-17 20:13 Noah Watkins
  2012-11-17 21:35 ` Josh Durgin
  2012-11-17 23:23 ` Sage Weil
  0 siblings, 2 replies; 11+ messages in thread
From: Noah Watkins @ 2012-11-17 20:13 UTC (permalink / raw)
  To: ceph-devel; +Cc: Sage Weil

The Hadoop VFS layer assumes that block size and replication can be
set on a per-file basis, which is important to users for file
layout/workload optimizations.

The libcephfs interface doesn't make this entirely easy. Here is one
approach, but it isn't thread safe as the default values are global
variables in the client.

  orig_obj_size = ceph_get_default_object_size() //save
  set_default_object_size(new size)
  open(path, O_CREAT)
  set_default_object_size(new size) //reset

Something more convenient might be:

  ceph_open_layout(path, flags, mode, layout, replication)

where layout and replication are used with O_CREAT | O_EXCL, or and
interface for setting these values explicitly on newly created files:

  ceph_open(path, O_CREAT|O_EXCL)
  ceph_set_layout(path, layout, replication)

where ceph_set_layout would succeed ostensibly on zero-length files.

Any thoughts on how to handle this?

Thanks,
Noah

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-11-20 21:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-17 20:13 libcephfs create file with layout and replication Noah Watkins
2012-11-17 21:35 ` Josh Durgin
2012-11-17 23:23 ` Sage Weil
2012-11-17 23:58   ` Noah Watkins
2012-11-18  0:15     ` Sage Weil
2012-11-18  1:20       ` Noah Watkins
2012-11-18 20:05         ` Noah Watkins
2012-11-20  1:04           ` Gregory Farnum
2012-11-20  2:48             ` Noah Watkins
2012-11-20  3:28               ` Sage Weil
2012-11-20 21:59                 ` Noah Watkins

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.