1
0
mirror of https://github.com/gluster/glusterd2.git synced 2026-02-05 12:45:38 +01:00
Files
glusterd2/pkg/api/subvoltype.go
Aravinda VK 6bf5113bfa volgen: Code based Volfile generation
Sub volumes support is added to Volinfo. Code based volfile generation
is implemented(Still exploring the possible approach to do that based on
input json/yml/toml)

All volfiles available in `$SRC/glusterd2/volgen2/volfile_*.go`

Features:

- Easy to add condition while generating volfile(For example, bitrot
  volfile only contains local bricks information)
- Easy to generate Cluster level, Volume level and Brick level volfiles
- Adding new volfile support is easy(Add one file)
- Full access to Cluster Info/Volume Info/Brick Info
- All supported volfiles are available now
- All generated volfiles are stored in etcd
- REST endpoint available to trigger regeneration of volfiles(Selective
  regeneration not yet available)

Limitations:
- Currently limited to code based volfile generation. If new volfile
  added or modified, Glusterd2 need to be recompiled. I tried template
  based approach to support cluster volfiles but it is getting over
  complecated. If this is not blocker now, we can proceed with this
  approach.

Future:
- Template file(json/yml/toml) support can be added on top of
  this if required.

Fixes: #388
Signed-off-by: Aravinda VK <avishwan@redhat.com>
2018-01-09 15:17:39 +05:30

15 lines
335 B
Go

package api
// SubvolType is the Type of the volume
//go:generate jsonenums -type=SubvolType
type SubvolType uint16
const (
// SubvolDistribute is a distribute sub volume
SubvolDistribute SubvolType = iota
// SubvolReplicate is a replicate sub volume
SubvolReplicate
// SubvolDisperse is a disperse sub volume
SubvolDisperse
)