mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-11 22:10:11 +01:00
chore(refactor): refactor scheduler for ZFS-LocalPV
Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
parent
30a7f2317e
commit
e1e8aa5839
3 changed files with 91 additions and 54 deletions
|
|
@ -33,6 +33,7 @@ import (
|
|||
errors "github.com/openebs/zfs-localpv/pkg/common/errors"
|
||||
"github.com/openebs/zfs-localpv/pkg/common/helpers"
|
||||
csipayload "github.com/openebs/zfs-localpv/pkg/response"
|
||||
schd "github.com/openebs/zfs-localpv/pkg/scheduler"
|
||||
analytics "github.com/openebs/zfs-localpv/pkg/usage"
|
||||
zfs "github.com/openebs/zfs-localpv/pkg/zfs"
|
||||
)
|
||||
|
|
@ -126,7 +127,13 @@ func CreateZFSVolume(req *csi.CreateVolumeRequest) (string, error) {
|
|||
|
||||
vtype := zfs.GetVolumeType(fstype)
|
||||
|
||||
selected := scheduler(req.AccessibilityRequirements, schld, pool)
|
||||
nmap, err := getNodeMap(schld, pool)
|
||||
if err != nil {
|
||||
return "", status.Errorf(codes.Internal, "get node map failed : %s", err.Error())
|
||||
}
|
||||
|
||||
// run the scheduler
|
||||
selected := schd.Scheduler(req, nmap)
|
||||
|
||||
if len(selected) == 0 {
|
||||
return "", status.Error(codes.Internal, "scheduler failed")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue