diff --git a/client/daemon/rpcserver/rpcserver.go b/client/daemon/rpcserver/rpcserver.go index 5046e9a2e8f..042655edad4 100644 --- a/client/daemon/rpcserver/rpcserver.go +++ b/client/daemon/rpcserver/rpcserver.go @@ -68,7 +68,7 @@ import ( schedulerclient "d7y.io/dragonfly/v2/pkg/rpc/scheduler/client" "d7y.io/dragonfly/v2/pkg/safe" "d7y.io/dragonfly/v2/pkg/source" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" ) type Server interface { diff --git a/client/daemon/rpcserver/rpcserver_test.go b/client/daemon/rpcserver/rpcserver_test.go index 1ec635596c0..fee3e8e2884 100644 --- a/client/daemon/rpcserver/rpcserver_test.go +++ b/client/daemon/rpcserver/rpcserver_test.go @@ -47,7 +47,7 @@ import ( dfdaemonclient "d7y.io/dragonfly/v2/pkg/rpc/dfdaemon/client" dfdaemonserver "d7y.io/dragonfly/v2/pkg/rpc/dfdaemon/server" schedulerclientmocks "d7y.io/dragonfly/v2/pkg/rpc/scheduler/client/mocks" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" ) func TestServer_New(t *testing.T) { diff --git a/manager/job/sync_peers.go b/manager/job/sync_peers.go index 81381755ae9..5f4fb494a7e 100644 --- a/manager/job/sync_peers.go +++ b/manager/job/sync_peers.go @@ -33,7 +33,7 @@ import ( "d7y.io/dragonfly/v2/manager/config" "d7y.io/dragonfly/v2/manager/models" "d7y.io/dragonfly/v2/pkg/idgen" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" ) // SyncPeers is an interface for sync peers. diff --git a/scheduler/job/job.go b/scheduler/job/job.go index 684b01c507e..007c5c95391 100644 --- a/scheduler/job/job.go +++ b/scheduler/job/job.go @@ -46,7 +46,7 @@ import ( "d7y.io/dragonfly/v2/pkg/idgen" dfdaemonclient "d7y.io/dragonfly/v2/pkg/rpc/dfdaemon/client" "d7y.io/dragonfly/v2/scheduler/config" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" ) // Job is an interface for job. diff --git a/scheduler/networktopology/mocks/network_topology_mock.go b/scheduler/networktopology/mocks/network_topology_mock.go index a0f25a61a43..a34f6a6c3c1 100644 --- a/scheduler/networktopology/mocks/network_topology_mock.go +++ b/scheduler/networktopology/mocks/network_topology_mock.go @@ -13,7 +13,7 @@ import ( reflect "reflect" networktopology "d7y.io/dragonfly/v2/scheduler/networktopology" - resource "d7y.io/dragonfly/v2/scheduler/resource" + standard "d7y.io/dragonfly/v2/scheduler/resource/standard" gomock "go.uber.org/mock/gomock" ) @@ -55,10 +55,10 @@ func (mr *MockNetworkTopologyMockRecorder) DeleteHost(arg0 any) *gomock.Call { } // FindProbedHosts mocks base method. -func (m *MockNetworkTopology) FindProbedHosts(arg0 string) ([]*resource.Host, error) { +func (m *MockNetworkTopology) FindProbedHosts(arg0 string) ([]*standard.Host, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "FindProbedHosts", arg0) - ret0, _ := ret[0].([]*resource.Host) + ret0, _ := ret[0].([]*standard.Host) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -84,10 +84,10 @@ func (mr *MockNetworkTopologyMockRecorder) Has(arg0, arg1 any) *gomock.Call { } // Neighbours mocks base method. -func (m *MockNetworkTopology) Neighbours(arg0 *resource.Host, arg1 int) ([]*resource.Host, error) { +func (m *MockNetworkTopology) Neighbours(arg0 *standard.Host, arg1 int) ([]*standard.Host, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Neighbours", arg0, arg1) - ret0, _ := ret[0].([]*resource.Host) + ret0, _ := ret[0].([]*standard.Host) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/scheduler/networktopology/network_topology.go b/scheduler/networktopology/network_topology.go index 5d1cdeee66b..98f65dca88f 100644 --- a/scheduler/networktopology/network_topology.go +++ b/scheduler/networktopology/network_topology.go @@ -33,7 +33,7 @@ import ( "d7y.io/dragonfly/v2/pkg/container/set" pkgredis "d7y.io/dragonfly/v2/pkg/redis" "d7y.io/dragonfly/v2/scheduler/config" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" "d7y.io/dragonfly/v2/scheduler/storage" ) diff --git a/scheduler/networktopology/network_topology_test.go b/scheduler/networktopology/network_topology_test.go index add38f9bcee..df4eb7d489c 100644 --- a/scheduler/networktopology/network_topology_test.go +++ b/scheduler/networktopology/network_topology_test.go @@ -30,7 +30,7 @@ import ( "d7y.io/dragonfly/v2/pkg/cache" "d7y.io/dragonfly/v2/pkg/container/set" pkgredis "d7y.io/dragonfly/v2/pkg/redis" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" storagemocks "d7y.io/dragonfly/v2/scheduler/storage/mocks" ) diff --git a/scheduler/networktopology/probes.go b/scheduler/networktopology/probes.go index a22d5dc3571..1652fe3da3f 100644 --- a/scheduler/networktopology/probes.go +++ b/scheduler/networktopology/probes.go @@ -31,7 +31,7 @@ import ( "d7y.io/dragonfly/v2/pkg/cache" pkgredis "d7y.io/dragonfly/v2/pkg/redis" "d7y.io/dragonfly/v2/scheduler/config" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" ) const ( diff --git a/scheduler/networktopology/probes_test.go b/scheduler/networktopology/probes_test.go index d1d142a2481..f616f686482 100644 --- a/scheduler/networktopology/probes_test.go +++ b/scheduler/networktopology/probes_test.go @@ -34,7 +34,7 @@ import ( pkgredis "d7y.io/dragonfly/v2/pkg/redis" "d7y.io/dragonfly/v2/pkg/types" "d7y.io/dragonfly/v2/scheduler/config" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" ) var ( diff --git a/scheduler/resource/host.go b/scheduler/resource/standard/host.go similarity index 99% rename from scheduler/resource/host.go rename to scheduler/resource/standard/host.go index 7256939e6e0..b860ff57dba 100644 --- a/scheduler/resource/host.go +++ b/scheduler/resource/standard/host.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package resource +package standard import ( "context" diff --git a/scheduler/resource/host_manager.go b/scheduler/resource/standard/host_manager.go similarity index 98% rename from scheduler/resource/host_manager.go rename to scheduler/resource/standard/host_manager.go index cd82071652f..ba75003ac82 100644 --- a/scheduler/resource/host_manager.go +++ b/scheduler/resource/standard/host_manager.go @@ -14,9 +14,9 @@ * limitations under the License. */ -//go:generate mockgen -destination host_manager_mock.go -source host_manager.go -package resource +//go:generate mockgen -destination host_manager_mock.go -source host_manager.go -package standard -package resource +package standard import ( "sync" diff --git a/scheduler/resource/host_manager_mock.go b/scheduler/resource/standard/host_manager_mock.go similarity index 98% rename from scheduler/resource/host_manager_mock.go rename to scheduler/resource/standard/host_manager_mock.go index b3b9ece0de1..fe8a49af92d 100644 --- a/scheduler/resource/host_manager_mock.go +++ b/scheduler/resource/standard/host_manager_mock.go @@ -3,11 +3,11 @@ // // Generated by this command: // -// mockgen -destination host_manager_mock.go -source host_manager.go -package resource +// mockgen -destination host_manager_mock.go -source host_manager.go -package standard // -// Package resource is a generated GoMock package. -package resource +// Package standard is a generated GoMock package. +package standard import ( reflect "reflect" diff --git a/scheduler/resource/host_manager_test.go b/scheduler/resource/standard/host_manager_test.go similarity index 99% rename from scheduler/resource/host_manager_test.go rename to scheduler/resource/standard/host_manager_test.go index b6145438232..0c6c0e3cb63 100644 --- a/scheduler/resource/host_manager_test.go +++ b/scheduler/resource/standard/host_manager_test.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package resource +package standard import ( "errors" diff --git a/scheduler/resource/host_test.go b/scheduler/resource/standard/host_test.go similarity index 99% rename from scheduler/resource/host_test.go rename to scheduler/resource/standard/host_test.go index a99ae6d13f8..ea87726254f 100644 --- a/scheduler/resource/host_test.go +++ b/scheduler/resource/standard/host_test.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package resource +package standard import ( "testing" diff --git a/scheduler/resource/peer.go b/scheduler/resource/standard/peer.go similarity index 99% rename from scheduler/resource/peer.go rename to scheduler/resource/standard/peer.go index 6b9a5d3cc3a..616a3e1ae05 100644 --- a/scheduler/resource/peer.go +++ b/scheduler/resource/standard/peer.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package resource +package standard import ( "context" diff --git a/scheduler/resource/peer_manager.go b/scheduler/resource/standard/peer_manager.go similarity index 99% rename from scheduler/resource/peer_manager.go rename to scheduler/resource/standard/peer_manager.go index c7eaa5e8319..54ef35d4fca 100644 --- a/scheduler/resource/peer_manager.go +++ b/scheduler/resource/standard/peer_manager.go @@ -14,9 +14,9 @@ * limitations under the License. */ -//go:generate mockgen -destination peer_manager_mock.go -source peer_manager.go -package resource +//go:generate mockgen -destination peer_manager_mock.go -source peer_manager.go -package standard -package resource +package standard import ( "context" diff --git a/scheduler/resource/peer_manager_mock.go b/scheduler/resource/standard/peer_manager_mock.go similarity index 97% rename from scheduler/resource/peer_manager_mock.go rename to scheduler/resource/standard/peer_manager_mock.go index d7539d7d759..d05449ad4cd 100644 --- a/scheduler/resource/peer_manager_mock.go +++ b/scheduler/resource/standard/peer_manager_mock.go @@ -3,11 +3,11 @@ // // Generated by this command: // -// mockgen -destination peer_manager_mock.go -source peer_manager.go -package resource +// mockgen -destination peer_manager_mock.go -source peer_manager.go -package standard // -// Package resource is a generated GoMock package. -package resource +// Package standard is a generated GoMock package. +package standard import ( reflect "reflect" diff --git a/scheduler/resource/peer_manager_test.go b/scheduler/resource/standard/peer_manager_test.go similarity index 99% rename from scheduler/resource/peer_manager_test.go rename to scheduler/resource/standard/peer_manager_test.go index e537230c296..d3be985216b 100644 --- a/scheduler/resource/peer_manager_test.go +++ b/scheduler/resource/standard/peer_manager_test.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package resource +package standard import ( "errors" diff --git a/scheduler/resource/peer_test.go b/scheduler/resource/standard/peer_test.go similarity index 99% rename from scheduler/resource/peer_test.go rename to scheduler/resource/standard/peer_test.go index 7505f3c0734..d20fd5b9619 100644 --- a/scheduler/resource/peer_test.go +++ b/scheduler/resource/standard/peer_test.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package resource +package standard import ( "errors" diff --git a/scheduler/resource/piece.go b/scheduler/resource/standard/piece.go similarity index 98% rename from scheduler/resource/piece.go rename to scheduler/resource/standard/piece.go index 752b049658e..76a46220a28 100644 --- a/scheduler/resource/piece.go +++ b/scheduler/resource/standard/piece.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package resource +package standard import ( "time" diff --git a/scheduler/resource/piece_test.go b/scheduler/resource/standard/piece_test.go similarity index 98% rename from scheduler/resource/piece_test.go rename to scheduler/resource/standard/piece_test.go index 65ea69a2026..8a64464cd7d 100644 --- a/scheduler/resource/piece_test.go +++ b/scheduler/resource/standard/piece_test.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package resource +package standard import ( "testing" diff --git a/scheduler/resource/resource.go b/scheduler/resource/standard/resource.go similarity index 99% rename from scheduler/resource/resource.go rename to scheduler/resource/standard/resource.go index 3735f98e573..305982fa034 100644 --- a/scheduler/resource/resource.go +++ b/scheduler/resource/standard/resource.go @@ -14,9 +14,9 @@ * limitations under the License. */ -//go:generate mockgen -destination resource_mock.go -source resource.go -package resource +//go:generate mockgen -destination resource_mock.go -source resource.go -package standard -package resource +package standard import ( "github.com/redis/go-redis/v9" diff --git a/scheduler/resource/resource_mock.go b/scheduler/resource/standard/resource_mock.go similarity index 97% rename from scheduler/resource/resource_mock.go rename to scheduler/resource/standard/resource_mock.go index 6e8bebcc42d..a2e8d877fa3 100644 --- a/scheduler/resource/resource_mock.go +++ b/scheduler/resource/standard/resource_mock.go @@ -3,11 +3,11 @@ // // Generated by this command: // -// mockgen -destination resource_mock.go -source resource.go -package resource +// mockgen -destination resource_mock.go -source resource.go -package standard // -// Package resource is a generated GoMock package. -package resource +// Package standard is a generated GoMock package. +package standard import ( reflect "reflect" diff --git a/scheduler/resource/resource_test.go b/scheduler/resource/standard/resource_test.go similarity index 99% rename from scheduler/resource/resource_test.go rename to scheduler/resource/standard/resource_test.go index 4ebb7986ecc..52cde770fef 100644 --- a/scheduler/resource/resource_test.go +++ b/scheduler/resource/standard/resource_test.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package resource +package standard import ( "errors" diff --git a/scheduler/resource/seed_peer.go b/scheduler/resource/standard/seed_peer.go similarity index 99% rename from scheduler/resource/seed_peer.go rename to scheduler/resource/standard/seed_peer.go index 989310b2c7d..c0ce9819a6b 100644 --- a/scheduler/resource/seed_peer.go +++ b/scheduler/resource/standard/seed_peer.go @@ -14,9 +14,9 @@ * limitations under the License. */ -//go:generate mockgen -destination seed_peer_mock.go -source seed_peer.go -package resource +//go:generate mockgen -destination seed_peer_mock.go -source seed_peer.go -package standard -package resource +package standard import ( "context" diff --git a/scheduler/resource/seed_peer_client.go b/scheduler/resource/standard/seed_peer_client.go similarity index 98% rename from scheduler/resource/seed_peer_client.go rename to scheduler/resource/standard/seed_peer_client.go index 638bea220d5..0d53f98fd14 100644 --- a/scheduler/resource/seed_peer_client.go +++ b/scheduler/resource/standard/seed_peer_client.go @@ -14,9 +14,9 @@ * limitations under the License. */ -//go:generate mockgen -destination seed_peer_client_mock.go -source seed_peer_client.go -package resource +//go:generate mockgen -destination seed_peer_client_mock.go -source seed_peer_client.go -package standard -package resource +package standard import ( "context" diff --git a/scheduler/resource/seed_peer_client_mock.go b/scheduler/resource/standard/seed_peer_client_mock.go similarity index 99% rename from scheduler/resource/seed_peer_client_mock.go rename to scheduler/resource/standard/seed_peer_client_mock.go index 94664d8d014..2a66b57b727 100644 --- a/scheduler/resource/seed_peer_client_mock.go +++ b/scheduler/resource/standard/seed_peer_client_mock.go @@ -3,11 +3,11 @@ // // Generated by this command: // -// mockgen -destination seed_peer_client_mock.go -source seed_peer_client.go -package resource +// mockgen -destination seed_peer_client_mock.go -source seed_peer_client.go -package standard // -// Package resource is a generated GoMock package. -package resource +// Package standard is a generated GoMock package. +package standard import ( context "context" diff --git a/scheduler/resource/seed_peer_client_test.go b/scheduler/resource/standard/seed_peer_client_test.go similarity index 99% rename from scheduler/resource/seed_peer_client_test.go rename to scheduler/resource/standard/seed_peer_client_test.go index 234b9a0ca43..d71328ea78a 100644 --- a/scheduler/resource/seed_peer_client_test.go +++ b/scheduler/resource/standard/seed_peer_client_test.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package resource +package standard import ( "errors" diff --git a/scheduler/resource/seed_peer_mock.go b/scheduler/resource/standard/seed_peer_mock.go similarity index 97% rename from scheduler/resource/seed_peer_mock.go rename to scheduler/resource/standard/seed_peer_mock.go index edc1c703a0f..85cd577af09 100644 --- a/scheduler/resource/seed_peer_mock.go +++ b/scheduler/resource/standard/seed_peer_mock.go @@ -3,11 +3,11 @@ // // Generated by this command: // -// mockgen -destination seed_peer_mock.go -source seed_peer.go -package resource +// mockgen -destination seed_peer_mock.go -source seed_peer.go -package standard // -// Package resource is a generated GoMock package. -package resource +// Package standard is a generated GoMock package. +package standard import ( context "context" diff --git a/scheduler/resource/seed_peer_test.go b/scheduler/resource/standard/seed_peer_test.go similarity index 99% rename from scheduler/resource/seed_peer_test.go rename to scheduler/resource/standard/seed_peer_test.go index 5e287803e44..86bd6e53590 100644 --- a/scheduler/resource/seed_peer_test.go +++ b/scheduler/resource/standard/seed_peer_test.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package resource +package standard import ( "context" diff --git a/scheduler/resource/task.go b/scheduler/resource/standard/task.go similarity index 99% rename from scheduler/resource/task.go rename to scheduler/resource/standard/task.go index 94da86cd637..2e819fe6dff 100644 --- a/scheduler/resource/task.go +++ b/scheduler/resource/standard/task.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package resource +package standard import ( "context" diff --git a/scheduler/resource/task_manager.go b/scheduler/resource/standard/task_manager.go similarity index 98% rename from scheduler/resource/task_manager.go rename to scheduler/resource/standard/task_manager.go index 5b78e46151b..92682dd8ad0 100644 --- a/scheduler/resource/task_manager.go +++ b/scheduler/resource/standard/task_manager.go @@ -14,9 +14,9 @@ * limitations under the License. */ -//go:generate mockgen -destination task_manager_mock.go -source task_manager.go -package resource +//go:generate mockgen -destination task_manager_mock.go -source task_manager.go -package standard -package resource +package standard import ( "sync" diff --git a/scheduler/resource/task_manager_mock.go b/scheduler/resource/standard/task_manager_mock.go similarity index 97% rename from scheduler/resource/task_manager_mock.go rename to scheduler/resource/standard/task_manager_mock.go index 412fc32571d..9e2d38a2b33 100644 --- a/scheduler/resource/task_manager_mock.go +++ b/scheduler/resource/standard/task_manager_mock.go @@ -3,11 +3,11 @@ // // Generated by this command: // -// mockgen -destination task_manager_mock.go -source task_manager.go -package resource +// mockgen -destination task_manager_mock.go -source task_manager.go -package standard // -// Package resource is a generated GoMock package. -package resource +// Package standard is a generated GoMock package. +package standard import ( reflect "reflect" diff --git a/scheduler/resource/task_manager_test.go b/scheduler/resource/standard/task_manager_test.go similarity index 99% rename from scheduler/resource/task_manager_test.go rename to scheduler/resource/standard/task_manager_test.go index c736eff91a0..a6ba5725152 100644 --- a/scheduler/resource/task_manager_test.go +++ b/scheduler/resource/standard/task_manager_test.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package resource +package standard import ( "errors" diff --git a/scheduler/resource/task_test.go b/scheduler/resource/standard/task_test.go similarity index 99% rename from scheduler/resource/task_test.go rename to scheduler/resource/standard/task_test.go index f2d0b8f04b5..3251e6768ff 100644 --- a/scheduler/resource/task_test.go +++ b/scheduler/resource/standard/task_test.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package resource +package standard import ( "errors" diff --git a/scheduler/rpcserver/rpcserver.go b/scheduler/rpcserver/rpcserver.go index a0d85401f6d..c7255c0dc56 100644 --- a/scheduler/rpcserver/rpcserver.go +++ b/scheduler/rpcserver/rpcserver.go @@ -22,7 +22,7 @@ import ( "d7y.io/dragonfly/v2/pkg/rpc/scheduler/server" "d7y.io/dragonfly/v2/scheduler/config" "d7y.io/dragonfly/v2/scheduler/networktopology" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" "d7y.io/dragonfly/v2/scheduler/scheduling" "d7y.io/dragonfly/v2/scheduler/storage" ) diff --git a/scheduler/rpcserver/rpcserver_test.go b/scheduler/rpcserver/rpcserver_test.go index b59588a0beb..f6fa179b3a3 100644 --- a/scheduler/rpcserver/rpcserver_test.go +++ b/scheduler/rpcserver/rpcserver_test.go @@ -27,7 +27,7 @@ import ( "d7y.io/dragonfly/v2/scheduler/config" configmocks "d7y.io/dragonfly/v2/scheduler/config/mocks" networktopologymocks "d7y.io/dragonfly/v2/scheduler/networktopology/mocks" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" "d7y.io/dragonfly/v2/scheduler/scheduling/mocks" storagemocks "d7y.io/dragonfly/v2/scheduler/storage/mocks" ) diff --git a/scheduler/rpcserver/scheduler_server_v1.go b/scheduler/rpcserver/scheduler_server_v1.go index 61aa78430e6..58c966804b0 100644 --- a/scheduler/rpcserver/scheduler_server_v1.go +++ b/scheduler/rpcserver/scheduler_server_v1.go @@ -29,7 +29,7 @@ import ( "d7y.io/dragonfly/v2/scheduler/config" "d7y.io/dragonfly/v2/scheduler/metrics" "d7y.io/dragonfly/v2/scheduler/networktopology" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" "d7y.io/dragonfly/v2/scheduler/scheduling" "d7y.io/dragonfly/v2/scheduler/service" "d7y.io/dragonfly/v2/scheduler/storage" diff --git a/scheduler/rpcserver/scheduler_server_v2.go b/scheduler/rpcserver/scheduler_server_v2.go index 0101b136808..1b7699e89b8 100644 --- a/scheduler/rpcserver/scheduler_server_v2.go +++ b/scheduler/rpcserver/scheduler_server_v2.go @@ -27,7 +27,7 @@ import ( "d7y.io/dragonfly/v2/scheduler/config" "d7y.io/dragonfly/v2/scheduler/metrics" "d7y.io/dragonfly/v2/scheduler/networktopology" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" "d7y.io/dragonfly/v2/scheduler/scheduling" "d7y.io/dragonfly/v2/scheduler/service" "d7y.io/dragonfly/v2/scheduler/storage" diff --git a/scheduler/scheduler.go b/scheduler/scheduler.go index 15d642434c9..ce4f1ade356 100644 --- a/scheduler/scheduler.go +++ b/scheduler/scheduler.go @@ -52,7 +52,7 @@ import ( "d7y.io/dragonfly/v2/scheduler/job" "d7y.io/dragonfly/v2/scheduler/metrics" "d7y.io/dragonfly/v2/scheduler/networktopology" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" "d7y.io/dragonfly/v2/scheduler/rpcserver" "d7y.io/dragonfly/v2/scheduler/scheduling" "d7y.io/dragonfly/v2/scheduler/scheduling/evaluator" diff --git a/scheduler/scheduling/evaluator/evaluator.go b/scheduler/scheduling/evaluator/evaluator.go index 16a1936d237..a4f5f47ec85 100644 --- a/scheduler/scheduling/evaluator/evaluator.go +++ b/scheduler/scheduling/evaluator/evaluator.go @@ -22,7 +22,7 @@ import ( "github.com/montanaflynn/stats" logger "d7y.io/dragonfly/v2/internal/dflog" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" ) const ( diff --git a/scheduler/scheduling/evaluator/evaluator_base.go b/scheduler/scheduling/evaluator/evaluator_base.go index aafc338bf60..d2024275376 100644 --- a/scheduler/scheduling/evaluator/evaluator_base.go +++ b/scheduler/scheduling/evaluator/evaluator_base.go @@ -22,7 +22,7 @@ import ( "d7y.io/dragonfly/v2/pkg/math" "d7y.io/dragonfly/v2/pkg/types" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" ) const ( diff --git a/scheduler/scheduling/evaluator/evaluator_base_test.go b/scheduler/scheduling/evaluator/evaluator_base_test.go index be1681f057a..1823fe380f5 100644 --- a/scheduler/scheduling/evaluator/evaluator_base_test.go +++ b/scheduler/scheduling/evaluator/evaluator_base_test.go @@ -30,7 +30,7 @@ import ( "d7y.io/dragonfly/v2/pkg/idgen" "d7y.io/dragonfly/v2/pkg/types" "d7y.io/dragonfly/v2/scheduler/config" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" ) var ( diff --git a/scheduler/scheduling/evaluator/evaluator_network_topology.go b/scheduler/scheduling/evaluator/evaluator_network_topology.go index b22cca87b31..f8ff364e00f 100644 --- a/scheduler/scheduling/evaluator/evaluator_network_topology.go +++ b/scheduler/scheduling/evaluator/evaluator_network_topology.go @@ -24,7 +24,7 @@ import ( "d7y.io/dragonfly/v2/pkg/math" "d7y.io/dragonfly/v2/pkg/types" "d7y.io/dragonfly/v2/scheduler/networktopology" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" ) const ( diff --git a/scheduler/scheduling/evaluator/evaluator_network_topology_test.go b/scheduler/scheduling/evaluator/evaluator_network_topology_test.go index abac75b5a8c..bbb7fc476de 100644 --- a/scheduler/scheduling/evaluator/evaluator_network_topology_test.go +++ b/scheduler/scheduling/evaluator/evaluator_network_topology_test.go @@ -31,7 +31,7 @@ import ( "d7y.io/dragonfly/v2/pkg/types" "d7y.io/dragonfly/v2/scheduler/networktopology" networktopologymocks "d7y.io/dragonfly/v2/scheduler/networktopology/mocks" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" ) func TestEvaluatorNetworkTopology_newEvaluatorNetworkTopology(t *testing.T) { diff --git a/scheduler/scheduling/evaluator/testdata/main.go b/scheduler/scheduling/evaluator/testdata/main.go index 52a56786506..2e349025094 100644 --- a/scheduler/scheduling/evaluator/testdata/main.go +++ b/scheduler/scheduling/evaluator/testdata/main.go @@ -20,7 +20,7 @@ import ( "fmt" "os" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" "d7y.io/dragonfly/v2/scheduler/scheduling/evaluator" ) diff --git a/scheduler/scheduling/evaluator/testdata/plugin/evaluator.go b/scheduler/scheduling/evaluator/testdata/plugin/evaluator.go index 4172759b9f0..b9247b6476b 100644 --- a/scheduler/scheduling/evaluator/testdata/plugin/evaluator.go +++ b/scheduler/scheduling/evaluator/testdata/plugin/evaluator.go @@ -16,7 +16,7 @@ package main -import "d7y.io/dragonfly/v2/scheduler/resource" +import resource "d7y.io/dragonfly/v2/scheduler/resource/standard" type evaluator struct{} diff --git a/scheduler/scheduling/mocks/scheduling_mock.go b/scheduler/scheduling/mocks/scheduling_mock.go index 6770eb4857e..605ab99e5ce 100644 --- a/scheduler/scheduling/mocks/scheduling_mock.go +++ b/scheduler/scheduling/mocks/scheduling_mock.go @@ -14,7 +14,7 @@ import ( reflect "reflect" set "d7y.io/dragonfly/v2/pkg/container/set" - resource "d7y.io/dragonfly/v2/scheduler/resource" + standard "d7y.io/dragonfly/v2/scheduler/resource/standard" gomock "go.uber.org/mock/gomock" ) @@ -42,10 +42,10 @@ func (m *MockScheduling) EXPECT() *MockSchedulingMockRecorder { } // FindCandidateParents mocks base method. -func (m *MockScheduling) FindCandidateParents(arg0 context.Context, arg1 *resource.Peer, arg2 set.SafeSet[string]) ([]*resource.Peer, bool) { +func (m *MockScheduling) FindCandidateParents(arg0 context.Context, arg1 *standard.Peer, arg2 set.SafeSet[string]) ([]*standard.Peer, bool) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "FindCandidateParents", arg0, arg1, arg2) - ret0, _ := ret[0].([]*resource.Peer) + ret0, _ := ret[0].([]*standard.Peer) ret1, _ := ret[1].(bool) return ret0, ret1 } @@ -57,10 +57,10 @@ func (mr *MockSchedulingMockRecorder) FindCandidateParents(arg0, arg1, arg2 any) } // FindParentAndCandidateParents mocks base method. -func (m *MockScheduling) FindParentAndCandidateParents(arg0 context.Context, arg1 *resource.Peer, arg2 set.SafeSet[string]) ([]*resource.Peer, bool) { +func (m *MockScheduling) FindParentAndCandidateParents(arg0 context.Context, arg1 *standard.Peer, arg2 set.SafeSet[string]) ([]*standard.Peer, bool) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "FindParentAndCandidateParents", arg0, arg1, arg2) - ret0, _ := ret[0].([]*resource.Peer) + ret0, _ := ret[0].([]*standard.Peer) ret1, _ := ret[1].(bool) return ret0, ret1 } @@ -72,10 +72,10 @@ func (mr *MockSchedulingMockRecorder) FindParentAndCandidateParents(arg0, arg1, } // FindSuccessParent mocks base method. -func (m *MockScheduling) FindSuccessParent(arg0 context.Context, arg1 *resource.Peer, arg2 set.SafeSet[string]) (*resource.Peer, bool) { +func (m *MockScheduling) FindSuccessParent(arg0 context.Context, arg1 *standard.Peer, arg2 set.SafeSet[string]) (*standard.Peer, bool) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "FindSuccessParent", arg0, arg1, arg2) - ret0, _ := ret[0].(*resource.Peer) + ret0, _ := ret[0].(*standard.Peer) ret1, _ := ret[1].(bool) return ret0, ret1 } @@ -87,7 +87,7 @@ func (mr *MockSchedulingMockRecorder) FindSuccessParent(arg0, arg1, arg2 any) *g } // ScheduleCandidateParents mocks base method. -func (m *MockScheduling) ScheduleCandidateParents(arg0 context.Context, arg1 *resource.Peer, arg2 set.SafeSet[string]) error { +func (m *MockScheduling) ScheduleCandidateParents(arg0 context.Context, arg1 *standard.Peer, arg2 set.SafeSet[string]) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ScheduleCandidateParents", arg0, arg1, arg2) ret0, _ := ret[0].(error) @@ -101,7 +101,7 @@ func (mr *MockSchedulingMockRecorder) ScheduleCandidateParents(arg0, arg1, arg2 } // ScheduleParentAndCandidateParents mocks base method. -func (m *MockScheduling) ScheduleParentAndCandidateParents(arg0 context.Context, arg1 *resource.Peer, arg2 set.SafeSet[string]) { +func (m *MockScheduling) ScheduleParentAndCandidateParents(arg0 context.Context, arg1 *standard.Peer, arg2 set.SafeSet[string]) { m.ctrl.T.Helper() m.ctrl.Call(m, "ScheduleParentAndCandidateParents", arg0, arg1, arg2) } diff --git a/scheduler/scheduling/scheduling.go b/scheduler/scheduling/scheduling.go index e9af5195ddd..8b5f503b46d 100644 --- a/scheduler/scheduling/scheduling.go +++ b/scheduler/scheduling/scheduling.go @@ -36,7 +36,7 @@ import ( "d7y.io/dragonfly/v2/pkg/container/set" "d7y.io/dragonfly/v2/pkg/types" "d7y.io/dragonfly/v2/scheduler/config" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" "d7y.io/dragonfly/v2/scheduler/scheduling/evaluator" ) diff --git a/scheduler/scheduling/scheduling_test.go b/scheduler/scheduling/scheduling_test.go index 0f576ec660c..009bf87114c 100644 --- a/scheduler/scheduling/scheduling_test.go +++ b/scheduler/scheduling/scheduling_test.go @@ -48,7 +48,7 @@ import ( pkgtypes "d7y.io/dragonfly/v2/pkg/types" "d7y.io/dragonfly/v2/scheduler/config" configmocks "d7y.io/dragonfly/v2/scheduler/config/mocks" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" "d7y.io/dragonfly/v2/scheduler/scheduling/evaluator" ) diff --git a/scheduler/service/service_v1.go b/scheduler/service/service_v1.go index d5a6e085613..cd58aa08589 100644 --- a/scheduler/service/service_v1.go +++ b/scheduler/service/service_v1.go @@ -46,7 +46,7 @@ import ( "d7y.io/dragonfly/v2/scheduler/config" "d7y.io/dragonfly/v2/scheduler/metrics" "d7y.io/dragonfly/v2/scheduler/networktopology" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" "d7y.io/dragonfly/v2/scheduler/scheduling" "d7y.io/dragonfly/v2/scheduler/storage" ) diff --git a/scheduler/service/service_v1_test.go b/scheduler/service/service_v1_test.go index e982b260aeb..f060cdf3b45 100644 --- a/scheduler/service/service_v1_test.go +++ b/scheduler/service/service_v1_test.go @@ -60,7 +60,7 @@ import ( configmocks "d7y.io/dragonfly/v2/scheduler/config/mocks" "d7y.io/dragonfly/v2/scheduler/networktopology" networktopologymocks "d7y.io/dragonfly/v2/scheduler/networktopology/mocks" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" "d7y.io/dragonfly/v2/scheduler/scheduling" "d7y.io/dragonfly/v2/scheduler/scheduling/mocks" "d7y.io/dragonfly/v2/scheduler/storage" diff --git a/scheduler/service/service_v2.go b/scheduler/service/service_v2.go index b406f19f0af..0975ec8b82a 100644 --- a/scheduler/service/service_v2.go +++ b/scheduler/service/service_v2.go @@ -40,7 +40,7 @@ import ( "d7y.io/dragonfly/v2/scheduler/config" "d7y.io/dragonfly/v2/scheduler/metrics" "d7y.io/dragonfly/v2/scheduler/networktopology" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" "d7y.io/dragonfly/v2/scheduler/scheduling" "d7y.io/dragonfly/v2/scheduler/storage" ) diff --git a/scheduler/service/service_v2_test.go b/scheduler/service/service_v2_test.go index 6a47f15488f..1882c48da81 100644 --- a/scheduler/service/service_v2_test.go +++ b/scheduler/service/service_v2_test.go @@ -50,7 +50,7 @@ import ( configmocks "d7y.io/dragonfly/v2/scheduler/config/mocks" "d7y.io/dragonfly/v2/scheduler/networktopology" networktopologymocks "d7y.io/dragonfly/v2/scheduler/networktopology/mocks" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" "d7y.io/dragonfly/v2/scheduler/scheduling/mocks" schedulingmocks "d7y.io/dragonfly/v2/scheduler/scheduling/mocks" storagemocks "d7y.io/dragonfly/v2/scheduler/storage/mocks" diff --git a/scheduler/storage/storage_test.go b/scheduler/storage/storage_test.go index 26c0b402860..48bf1c36ae4 100644 --- a/scheduler/storage/storage_test.go +++ b/scheduler/storage/storage_test.go @@ -30,7 +30,7 @@ import ( "github.com/stretchr/testify/assert" "d7y.io/dragonfly/v2/scheduler/config" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" ) var ( diff --git a/scheduler/storage/types.go b/scheduler/storage/types.go index da3cd1bb165..eb433125ff1 100644 --- a/scheduler/storage/types.go +++ b/scheduler/storage/types.go @@ -19,7 +19,7 @@ package storage import ( "time" - "d7y.io/dragonfly/v2/scheduler/resource" + resource "d7y.io/dragonfly/v2/scheduler/resource/standard" ) // Task contains content for task.