From 168d8427968d740e1a567f463d078b6182fe719f Mon Sep 17 00:00:00 2001 From: Cody Roseborough Date: Thu, 28 Jul 2016 15:44:09 -0700 Subject: [PATCH] Updates scheduler managesMetrics interface Updates scheduler managesMetrics interface to use core.Metric all the way through a workflow instead of switching to bytes for process and publish. This removes the un-implemented contentType feature and associated testing/partial implementations. --- control/control_test.go | 7 +- control/plugin/client/grpc.go | 4 +- grpc/common/common.pb.go | 149 ++++---- grpc/controlproxy/controlproxy_medium_test.go | 1 - grpc/controlproxy/rpc/control.pb.go | 354 ++++-------------- scheduler/job.go | 253 +++---------- scheduler/scheduler.go | 21 +- scheduler/scheduler_medium_test.go | 48 +-- scheduler/scheduler_test.go | 71 +--- scheduler/task_test.go | 5 - scheduler/work_manager_test.go | 5 + scheduler/workflow.go | 81 ---- 12 files changed, 208 insertions(+), 791 deletions(-) diff --git a/control/control_test.go b/control/control_test.go index 3a9e2cb5c..d39a72f40 100644 --- a/control/control_test.go +++ b/control/control_test.go @@ -1729,7 +1729,9 @@ func TestDynamicMetricSubscriptionLoadLessMetrics(t *testing.T) { Convey("metrics are collected from mock1", func() { for _, m := range mts1 { if strings.Contains(m.Namespace().String(), "host") { - val, ok := m.Data().(int64) + // Because mock1 uses jsonrpc, all number typers are interpreted + // as float64 + val, ok := m.Data().(float64) So(ok, ShouldEqual, true) So(val, ShouldBeLessThan, 100) } else { @@ -1738,9 +1740,6 @@ func TestDynamicMetricSubscriptionLoadLessMetrics(t *testing.T) { } } }) - // ensure the data coming back is from v1. V1's data is type string - _, ok := mts1[0].Data().(string) - So(ok, ShouldEqual, true) Convey("Loading higher plugin version with less metrics", func() { // Load version snap-plugin-collector-mock2 _, err := load(c, path.Join(fixtures.SnapPath, "plugin", "snap-plugin-collector-mock2")) diff --git a/control/plugin/client/grpc.go b/control/plugin/client/grpc.go index 3edeffadd..bae213fd4 100644 --- a/control/plugin/client/grpc.go +++ b/control/plugin/client/grpc.go @@ -466,8 +466,8 @@ func ParseConfig(config *rpc.ConfigMap) map[string]ctypes.ConfigValue { return c } -func ToTime(t time.Time) *Time { - return &Time{ +func ToTime(t time.Time) *rpc.Time { + return &rpc.Time{ Nsec: t.Unix(), Sec: int64(t.Second()), } diff --git a/grpc/common/common.pb.go b/grpc/common/common.pb.go index 57e413bc5..ffd3a7358 100644 --- a/grpc/common/common.pb.go +++ b/grpc/common/common.pb.go @@ -74,8 +74,8 @@ func (*Empty) ProtoMessage() {} func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } type SnapError struct { - ErrorString string `protobuf:"bytes,1,opt,name=error_string" json:"error_string,omitempty"` - ErrorFields map[string]string `protobuf:"bytes,2,rep,name=error_fields" json:"error_fields,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + ErrorString string `protobuf:"bytes,1,opt,name=error_string,json=errorString" json:"error_string,omitempty"` + ErrorFields map[string]string `protobuf:"bytes,2,rep,name=error_fields,json=errorFields" json:"error_fields,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` } func (m *SnapError) Reset() { *m = SnapError{} } @@ -102,14 +102,14 @@ func (*Label) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } // core.Metric type Metric struct { - Namespace []*NamespaceElement `protobuf:"bytes,1,rep,name=Namespace" json:"Namespace,omitempty"` - Version int64 `protobuf:"varint,2,opt,name=Version" json:"Version,omitempty"` - Config *ConfigMap `protobuf:"bytes,3,opt,name=Config" json:"Config,omitempty"` - LastAdvertisedTime *Time `protobuf:"bytes,4,opt,name=LastAdvertisedTime" json:"LastAdvertisedTime,omitempty"` - Tags map[string]string `protobuf:"bytes,5,rep,name=Tags" json:"Tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Timestamp *Time `protobuf:"bytes,6,opt,name=Timestamp" json:"Timestamp,omitempty"` - Unit string `protobuf:"bytes,7,opt,name=Unit" json:"Unit,omitempty"` - Description string `protobuf:"bytes,8,opt,name=Description" json:"Description,omitempty"` + Namespace []*NamespaceElement `protobuf:"bytes,1,rep,name=Namespace,json=namespace" json:"Namespace,omitempty"` + Version int64 `protobuf:"varint,2,opt,name=Version,json=version" json:"Version,omitempty"` + Config *ConfigMap `protobuf:"bytes,3,opt,name=Config,json=config" json:"Config,omitempty"` + LastAdvertisedTime *Time `protobuf:"bytes,4,opt,name=LastAdvertisedTime,json=lastAdvertisedTime" json:"LastAdvertisedTime,omitempty"` + Tags map[string]string `protobuf:"bytes,5,rep,name=Tags,json=tags" json:"Tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Timestamp *Time `protobuf:"bytes,6,opt,name=Timestamp,json=timestamp" json:"Timestamp,omitempty"` + Unit string `protobuf:"bytes,7,opt,name=Unit,json=unit" json:"Unit,omitempty"` + Description string `protobuf:"bytes,8,opt,name=Description,json=description" json:"Description,omitempty"` // Types that are valid to be assigned to Data: // *Metric_StringData // *Metric_Float32Data @@ -130,22 +130,22 @@ type isMetric_Data interface { } type Metric_StringData struct { - StringData string `protobuf:"bytes,9,opt,name=string_data,oneof"` + StringData string `protobuf:"bytes,9,opt,name=string_data,json=stringData,oneof"` } type Metric_Float32Data struct { - Float32Data float32 `protobuf:"fixed32,10,opt,name=float32_data,oneof"` + Float32Data float32 `protobuf:"fixed32,10,opt,name=float32_data,json=float32Data,oneof"` } type Metric_Float64Data struct { - Float64Data float64 `protobuf:"fixed64,11,opt,name=float64_data,oneof"` + Float64Data float64 `protobuf:"fixed64,11,opt,name=float64_data,json=float64Data,oneof"` } type Metric_Int32Data struct { - Int32Data int32 `protobuf:"varint,12,opt,name=int32_data,oneof"` + Int32Data int32 `protobuf:"varint,12,opt,name=int32_data,json=int32Data,oneof"` } type Metric_Int64Data struct { - Int64Data int64 `protobuf:"varint,13,opt,name=int64_data,oneof"` + Int64Data int64 `protobuf:"varint,13,opt,name=int64_data,json=int64Data,oneof"` } type Metric_BytesData struct { - BytesData []byte `protobuf:"bytes,14,opt,name=bytes_data,proto3,oneof"` + BytesData []byte `protobuf:"bytes,14,opt,name=bytes_data,json=bytesData,proto3,oneof"` } func (*Metric_StringData) isMetric_Data() {} @@ -362,9 +362,9 @@ func _Metric_OneofSizer(msg proto.Message) (n int) { } type NamespaceElement struct { - Value string `protobuf:"bytes,1,opt,name=Value" json:"Value,omitempty"` - Description string `protobuf:"bytes,2,opt,name=Description" json:"Description,omitempty"` - Name string `protobuf:"bytes,3,opt,name=Name" json:"Name,omitempty"` + Value string `protobuf:"bytes,1,opt,name=Value,json=value" json:"Value,omitempty"` + Description string `protobuf:"bytes,2,opt,name=Description,json=description" json:"Description,omitempty"` + Name string `protobuf:"bytes,3,opt,name=Name,json=name" json:"Name,omitempty"` } func (m *NamespaceElement) Reset() { *m = NamespaceElement{} } @@ -374,10 +374,10 @@ func (*NamespaceElement) Descriptor() ([]byte, []int) { return fileDescriptor0, // core.SubscribedPlugin type SubscribedPlugin struct { - TypeName string `protobuf:"bytes,1,opt,name=TypeName" json:"TypeName,omitempty"` - Name string `protobuf:"bytes,2,opt,name=Name" json:"Name,omitempty"` - Version int64 `protobuf:"varint,3,opt,name=Version" json:"Version,omitempty"` - Config *ConfigMap `protobuf:"bytes,4,opt,name=Config" json:"Config,omitempty"` + TypeName string `protobuf:"bytes,1,opt,name=TypeName,json=typeName" json:"TypeName,omitempty"` + Name string `protobuf:"bytes,2,opt,name=Name,json=name" json:"Name,omitempty"` + Version int64 `protobuf:"varint,3,opt,name=Version,json=version" json:"Version,omitempty"` + Config *ConfigMap `protobuf:"bytes,4,opt,name=Config,json=config" json:"Config,omitempty"` } func (m *SubscribedPlugin) Reset() { *m = SubscribedPlugin{} } @@ -393,11 +393,11 @@ func (m *SubscribedPlugin) GetConfig() *ConfigMap { } type ConfigMap struct { - IntMap map[string]int64 `protobuf:"bytes,1,rep,name=IntMap" json:"IntMap,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` - StringMap map[string]string `protobuf:"bytes,2,rep,name=StringMap" json:"StringMap,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + IntMap map[string]int64 `protobuf:"bytes,1,rep,name=IntMap,json=intMap" json:"IntMap,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + StringMap map[string]string `protobuf:"bytes,2,rep,name=StringMap,json=stringMap" json:"StringMap,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // double is float64 - FloatMap map[string]float64 `protobuf:"bytes,3,rep,name=FloatMap" json:"FloatMap,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"fixed64,2,opt,name=value"` - BoolMap map[string]bool `protobuf:"bytes,4,rep,name=BoolMap" json:"BoolMap,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + FloatMap map[string]float64 `protobuf:"bytes,3,rep,name=FloatMap,json=floatMap" json:"FloatMap,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"fixed64,2,opt,name=value"` + BoolMap map[string]bool `protobuf:"bytes,4,rep,name=BoolMap,json=boolMap" json:"BoolMap,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` } func (m *ConfigMap) Reset() { *m = ConfigMap{} } @@ -435,9 +435,9 @@ func (m *ConfigMap) GetBoolMap() map[string]bool { // core.Plugin type Plugin struct { - TypeName string `protobuf:"bytes,1,opt,name=TypeName" json:"TypeName,omitempty"` - Name string `protobuf:"bytes,2,opt,name=Name" json:"Name,omitempty"` - Version int64 `protobuf:"varint,3,opt,name=Version" json:"Version,omitempty"` + TypeName string `protobuf:"bytes,1,opt,name=TypeName,json=typeName" json:"TypeName,omitempty"` + Name string `protobuf:"bytes,2,opt,name=Name,json=name" json:"Name,omitempty"` + Version int64 `protobuf:"varint,3,opt,name=Version,json=version" json:"Version,omitempty"` } func (m *Plugin) Reset() { *m = Plugin{} } @@ -462,45 +462,52 @@ func init() { } var fileDescriptor0 = []byte{ - // 630 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x54, 0xef, 0x4f, 0xd3, 0x40, - 0x18, 0xa6, 0xb4, 0xeb, 0xd6, 0xb7, 0x05, 0xe7, 0x89, 0xa6, 0x59, 0xa2, 0x40, 0x63, 0x0c, 0x89, - 0xa1, 0xd3, 0xcd, 0x18, 0xf4, 0x9b, 0xc8, 0x08, 0x26, 0x60, 0x4c, 0x40, 0xbe, 0x92, 0xdb, 0x7a, - 0x9b, 0x17, 0xdb, 0x6b, 0xd3, 0xbb, 0x11, 0xf6, 0x57, 0xf8, 0xc9, 0x3f, 0xc7, 0xff, 0xcd, 0xfb, - 0xd1, 0x8e, 0xc1, 0x40, 0x12, 0xbf, 0x40, 0xef, 0x79, 0x9f, 0xe7, 0xdd, 0x73, 0xef, 0xf3, 0xb6, - 0xd0, 0x9f, 0x50, 0xf1, 0x63, 0x3a, 0x8c, 0x47, 0x79, 0xd6, 0xa5, 0x4c, 0x90, 0x94, 0x27, 0x74, - 0xf7, 0xaa, 0xcb, 0x19, 0x2e, 0xba, 0x93, 0xb2, 0x18, 0x75, 0x65, 0x21, 0xcb, 0x59, 0xf5, 0x2f, - 0x2e, 0xca, 0x5c, 0xe4, 0xc8, 0x35, 0xa7, 0x68, 0x1b, 0x9c, 0x33, 0x9a, 0x11, 0xe4, 0x83, 0xcd, - 0xc9, 0x28, 0xb4, 0xb6, 0xac, 0x1d, 0x1b, 0x05, 0xe0, 0x30, 0x75, 0x5a, 0x55, 0xa7, 0xa8, 0x09, - 0x8d, 0x41, 0x56, 0x88, 0x59, 0xf4, 0xcb, 0x02, 0xef, 0x54, 0x76, 0x1d, 0x94, 0x65, 0x5e, 0xa2, - 0x0d, 0x08, 0x88, 0x7a, 0xb8, 0xe0, 0xa2, 0xa4, 0x6c, 0xa2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 0x98, 0x53, 0x8c, 0xe8, 0x2d, 0xb4, 0x0e, 0x55, 0x5c, 0x4a, - 0x63, 0x6b, 0xcd, 0xe6, 0xb2, 0xa6, 0x66, 0x18, 0x49, 0x17, 0x9a, 0xfb, 0x79, 0x9e, 0x2a, 0x85, - 0xa3, 0x15, 0x2f, 0x96, 0x15, 0x15, 0xc1, 0xbc, 0x9d, 0xbb, 0xe0, 0x2f, 0xfa, 0xbc, 0x3f, 0x3a, - 0x5b, 0x45, 0xd7, 0x79, 0x03, 0xeb, 0xb7, 0x4c, 0x3e, 0x10, 0x76, 0xa7, 0x0b, 0x6b, 0x37, 0x2d, - 0xde, 0x2f, 0xb0, 0xb4, 0x20, 0x86, 0x60, 0xd1, 0xe1, 0x3f, 0xf8, 0x2d, 0xfd, 0xad, 0xf8, 0x00, - 0xee, 0x7f, 0xa6, 0x3e, 0x74, 0xf5, 0x37, 0xb3, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, 0xa7, 0x86, - 0x01, 0x7e, 0x6a, 0x05, 0x00, 0x00, + // 738 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x55, 0xdd, 0x6e, 0xd3, 0x4c, + 0x10, 0xfd, 0x1c, 0x3b, 0x4e, 0x3c, 0x4e, 0xab, 0x7c, 0x2b, 0x2e, 0xac, 0x48, 0xd0, 0x62, 0x6e, + 0x0a, 0x82, 0x44, 0xb4, 0xa5, 0x94, 0xb6, 0xaa, 0x44, 0x69, 0x2a, 0x90, 0x5a, 0x84, 0xdc, 0xd2, + 0x4b, 0x2a, 0x27, 0xde, 0x84, 0x15, 0xf6, 0xda, 0xf2, 0x6e, 0xaa, 0xe6, 0x09, 0x78, 0x22, 0xde, + 0x88, 0x3b, 0x5e, 0x82, 0xfd, 0xb1, 0x53, 0xa7, 0x01, 0x45, 0x95, 0xb8, 0x69, 0x67, 0xce, 0x9e, + 0x33, 0xbb, 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6, + 0x28, 0x4e, 0x43, 0xbe, 0xb5, 0xa9, 0x39, 0x20, 0x38, 0x35, 0xc1, 0x71, 0x0b, 0x74, 0x8e, 0xb4, + 0xb3, 0xad, 0x49, 0xae, 0x20, 0x19, 0x33, 0xd2, 0xce, 0xb6, 0x22, 0xad, 0x01, 0x88, 0x0f, 0xa3, + 0xac, 0xd3, 0x12, 0x94, 0xba, 0xa0, 0x38, 0x0a, 0xab, 0x10, 0xca, 0x1a, 0x2b, 0xf2, 0x8e, 0x0a, + 0xc2, 0x6d, 0x85, 0xc1, 0x94, 0x63, 0xa6, 0x09, 0xab, 0x82, 0xd0, 0x92, 0x04, 0x85, 0x49, 0x42, + 0xe7, 0xb5, 0x98, 0x58, 0x39, 0xc4, 0xfb, 0x38, 0xf2, 0xc8, 0x06, 0x4b, 0xd6, 0xf4, 0xbf, 0x40, + 0xfb, 0xae, 0x85, 0xa4, 0xea, 0x52, 0xa9, 0x8c, 0x8a, 0xea, 0xee, 0x70, 0x6b, 0x8b, 0xc3, 0x15, + 0x57, 0x22, 0x6b, 0x29, 0x4f, 0x95, 0x36, 0xfe, 0x6e, 0x40, 0xfb, 0x7c, 0x32, 0x90, 0xa4, 0x01, + 0x8e, 0x3e, 0xc5, 0x93, 0x31, 0xa1, 0xa8, 0x03, 0xcd, 0x8b, 0x69, 0x86, 0x15, 0x59, 0xef, 0xd1, + 0xe4, 0x45, 0x3e, 0x2b, 0x52, 0xf9, 0x16, 0xaa, 0x46, 0x36, 0xff, 0x66, 0x64, 0x6b, 0x89, 0x91, + 0xfd, 0x5f, 0x26, 0x38, 0x33, 0x14, 0xbd, 0x02, 0xfb, 0x03, 0xe5, 0x22, 0x2a, 0x3e, 0xa8, 0x87, + 0x0b, 0xc2, 0xae, 0x5e, 0xd7, 0xfe, 0xb4, 0x89, 0x4a, 0xd0, 0xa1, 0x78, 0x7f, 0x94, 0x55, 0xa4, + 0x52, 0x3f, 0x26, 0xeb, 0x8b, 0xca, 0x19, 0x45, 0x8b, 0x1d, 0x56, 0xe6, 0x68, 0x1f, 0x9a, 0x27, + 0xd2, 0x21, 0x52, 0x6e, 0x2a, 0xf9, 0xda, 0xa2, 0xbc, 0x64, 0x68, 0x75, 0x73, 0x54, 0xa4, 0x68, + 0x17, 0x1a, 0x47, 0x69, 0x1a, 0x4b, 0xad, 0xa5, 0xb4, 0x8f, 0x16, 0xb5, 0x05, 0x41, 0x4b, 0x1b, + 0x03, 0x9d, 0x75, 0xde, 0x80, 0x5b, 0xe9, 0x66, 0x99, 0x51, 0xcc, 0x8a, 0x51, 0x3a, 0x07, 0xb0, + 0x3a, 0xdf, 0xce, 0x7d, 0x6c, 0xd6, 0xd9, 0x87, 0x95, 0xb9, 0x6e, 0x96, 0x89, 0x8d, 0xaa, 0x78, + 0x0f, 0x5a, 0xd5, 0x76, 0x96, 0x69, 0x9b, 0xd5, 0x17, 0x37, 0x00, 0xfb, 0x5f, 0x9b, 0x6d, 0x60, + 0xab, 0xdf, 0xb0, 0xad, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xfa, 0xc3, 0x4f, 0x62, 0xfa, 0x06, + 0x00, 0x00, } diff --git a/grpc/controlproxy/controlproxy_medium_test.go b/grpc/controlproxy/controlproxy_medium_test.go index 6b0a4d8f7..1085c0ef5 100644 --- a/grpc/controlproxy/controlproxy_medium_test.go +++ b/grpc/controlproxy/controlproxy_medium_test.go @@ -49,7 +49,6 @@ type mockClient struct { ValidateReply *rpc.ValidateDepsReply SubscribeReply *rpc.SubscribeDepsReply UnsubscribeReply *rpc.UnsubscribeDepsReply - MatchReply *rpc.ExpandWildcardsReply AutoDiscoReply *rpc.GetAutodiscoverPathsReply } diff --git a/grpc/controlproxy/rpc/control.pb.go b/grpc/controlproxy/rpc/control.pb.go index 0f4887784..46809e467 100644 --- a/grpc/controlproxy/rpc/control.pb.go +++ b/grpc/controlproxy/rpc/control.pb.go @@ -32,8 +32,6 @@ It has these top-level messages: PubProcMetricsRequest ErrorReply ProcessMetricsReply - GetPluginContentTypesRequest - GetPluginContentTypesReply ValidateDepsRequest ValidateDepsReply SubscribeDepsRequest @@ -44,9 +42,7 @@ It has these top-level messages: MapEntry CollectMetricsRequest CollectMetricsResponse - ExpandWildcardsRequest ArrString - ExpandWildcardsReply GetAutodiscoverPathsReply */ package rpc @@ -133,28 +129,6 @@ func (m *ProcessMetricsReply) GetMetrics() []*common.Metric { return nil } -type GetPluginContentTypesRequest struct { - Name string `protobuf:"bytes,1,opt,name=Name,json=name" json:"Name,omitempty"` - PluginType int32 `protobuf:"varint,2,opt,name=PluginType,json=pluginType" json:"PluginType,omitempty"` - Version int32 `protobuf:"varint,3,opt,name=Version,json=version" json:"Version,omitempty"` -} - -func (m *GetPluginContentTypesRequest) Reset() { *m = GetPluginContentTypesRequest{} } -func (m *GetPluginContentTypesRequest) String() string { return proto.CompactTextString(m) } -func (*GetPluginContentTypesRequest) ProtoMessage() {} -func (*GetPluginContentTypesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } - -type GetPluginContentTypesReply struct { - AcceptedTypes []string `protobuf:"bytes,1,rep,name=AcceptedTypes,json=acceptedTypes" json:"AcceptedTypes,omitempty"` - ReturnedTypes []string `protobuf:"bytes,2,rep,name=ReturnedTypes,json=returnedTypes" json:"ReturnedTypes,omitempty"` - Error string `protobuf:"bytes,3,opt,name=Error,json=error" json:"Error,omitempty"` -} - -func (m *GetPluginContentTypesReply) Reset() { *m = GetPluginContentTypesReply{} } -func (m *GetPluginContentTypesReply) String() string { return proto.CompactTextString(m) } -func (*GetPluginContentTypesReply) ProtoMessage() {} -func (*GetPluginContentTypesReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } - type ValidateDepsRequest struct { Metrics []*common.Metric `protobuf:"bytes,1,rep,name=Metrics,json=metrics" json:"Metrics,omitempty"` Plugins []*common.SubscribedPlugin `protobuf:"bytes,2,rep,name=Plugins,json=plugins" json:"Plugins,omitempty"` @@ -163,7 +137,7 @@ type ValidateDepsRequest struct { func (m *ValidateDepsRequest) Reset() { *m = ValidateDepsRequest{} } func (m *ValidateDepsRequest) String() string { return proto.CompactTextString(m) } func (*ValidateDepsRequest) ProtoMessage() {} -func (*ValidateDepsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } +func (*ValidateDepsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } func (m *ValidateDepsRequest) GetMetrics() []*common.Metric { if m != nil { @@ -186,7 +160,7 @@ type ValidateDepsReply struct { func (m *ValidateDepsReply) Reset() { *m = ValidateDepsReply{} } func (m *ValidateDepsReply) String() string { return proto.CompactTextString(m) } func (*ValidateDepsReply) ProtoMessage() {} -func (*ValidateDepsReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } +func (*ValidateDepsReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } func (m *ValidateDepsReply) GetErrors() []*common.SnapError { if m != nil { @@ -196,21 +170,15 @@ func (m *ValidateDepsReply) GetErrors() []*common.SnapError { } type SubscribeDepsRequest struct { -<<<<<<< HEAD - Requested []*common.Metric `protobuf:"bytes,1,rep,name=Requested" json:"Requested,omitempty"` - Plugins []*common.SubscribedPlugin `protobuf:"bytes,2,rep,name=Plugins" json:"Plugins,omitempty"` - TaskId string `protobuf:"bytes,3,opt,name=TaskId" json:"TaskId,omitempty"` -======= - Metrics []*common.Metric `protobuf:"bytes,1,rep,name=Metrics,json=metrics" json:"Metrics,omitempty"` - Plugins []*common.Plugin `protobuf:"bytes,2,rep,name=Plugins,json=plugins" json:"Plugins,omitempty"` - TaskId string `protobuf:"bytes,3,opt,name=TaskId,json=taskId" json:"TaskId,omitempty"` ->>>>>>> Updates controlproxy to match new managesMetrics + Requested []*common.Metric `protobuf:"bytes,1,rep,name=Requested,json=requested" json:"Requested,omitempty"` + Plugins []*common.SubscribedPlugin `protobuf:"bytes,2,rep,name=Plugins,json=plugins" json:"Plugins,omitempty"` + TaskId string `protobuf:"bytes,3,opt,name=TaskId,json=taskId" json:"TaskId,omitempty"` } func (m *SubscribeDepsRequest) Reset() { *m = SubscribeDepsRequest{} } func (m *SubscribeDepsRequest) String() string { return proto.CompactTextString(m) } func (*SubscribeDepsRequest) ProtoMessage() {} -func (*SubscribeDepsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } +func (*SubscribeDepsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } func (m *SubscribeDepsRequest) GetRequested() []*common.Metric { if m != nil { @@ -233,7 +201,7 @@ type SubscribeDepsReply struct { func (m *SubscribeDepsReply) Reset() { *m = SubscribeDepsReply{} } func (m *SubscribeDepsReply) String() string { return proto.CompactTextString(m) } func (*SubscribeDepsReply) ProtoMessage() {} -func (*SubscribeDepsReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } +func (*SubscribeDepsReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } func (m *SubscribeDepsReply) GetErrors() []*common.SnapError { if m != nil { @@ -243,22 +211,22 @@ func (m *SubscribeDepsReply) GetErrors() []*common.SnapError { } type UnsubscribeDepsRequest struct { - TaskId string `protobuf:"bytes,1,opt,name=TaskId" json:"TaskId,omitempty"` + TaskId string `protobuf:"bytes,1,opt,name=TaskId,json=taskId" json:"TaskId,omitempty"` } func (m *UnsubscribeDepsRequest) Reset() { *m = UnsubscribeDepsRequest{} } func (m *UnsubscribeDepsRequest) String() string { return proto.CompactTextString(m) } func (*UnsubscribeDepsRequest) ProtoMessage() {} -func (*UnsubscribeDepsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } +func (*UnsubscribeDepsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } type UnsubscribeDepsReply struct { - Errors []*common.SnapError `protobuf:"bytes,1,rep,name=Errors" json:"Errors,omitempty"` + Errors []*common.SnapError `protobuf:"bytes,1,rep,name=Errors,json=errors" json:"Errors,omitempty"` } func (m *UnsubscribeDepsReply) Reset() { *m = UnsubscribeDepsReply{} } func (m *UnsubscribeDepsReply) String() string { return proto.CompactTextString(m) } func (*UnsubscribeDepsReply) ProtoMessage() {} -func (*UnsubscribeDepsReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } +func (*UnsubscribeDepsReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } func (m *UnsubscribeDepsReply) GetErrors() []*common.SnapError { if m != nil { @@ -274,7 +242,7 @@ type Map struct { func (m *Map) Reset() { *m = Map{} } func (m *Map) String() string { return proto.CompactTextString(m) } func (*Map) ProtoMessage() {} -func (*Map) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } +func (*Map) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } func (m *Map) GetEntries() []*MapEntry { if m != nil { @@ -291,24 +259,17 @@ type MapEntry struct { func (m *MapEntry) Reset() { *m = MapEntry{} } func (m *MapEntry) String() string { return proto.CompactTextString(m) } func (*MapEntry) ProtoMessage() {} -func (*MapEntry) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } +func (*MapEntry) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } type CollectMetricsRequest struct { -<<<<<<< HEAD - TaskID string `protobuf:"bytes,1,opt,name=TaskID" json:"TaskID,omitempty"` - AllTags map[string]*Map `protobuf:"bytes,2,rep,name=AllTags" json:"AllTags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` -======= - TaskID string `protobuf:"bytes,1,opt,name=TaskID,json=taskID" json:"TaskID,omitempty"` - Metrics []*common.Metric `protobuf:"bytes,2,rep,name=Metrics,json=metrics" json:"Metrics,omitempty"` - Deadline *common.Time `protobuf:"bytes,3,opt,name=Deadline,json=deadline" json:"Deadline,omitempty"` - AllTags map[string]*Map `protobuf:"bytes,4,rep,name=AllTags,json=allTags" json:"AllTags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` ->>>>>>> Updates controlproxy to match new managesMetrics + TaskID string `protobuf:"bytes,1,opt,name=TaskID,json=taskID" json:"TaskID,omitempty"` + AllTags map[string]*Map `protobuf:"bytes,2,rep,name=AllTags,json=allTags" json:"AllTags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` } func (m *CollectMetricsRequest) Reset() { *m = CollectMetricsRequest{} } func (m *CollectMetricsRequest) String() string { return proto.CompactTextString(m) } func (*CollectMetricsRequest) ProtoMessage() {} -func (*CollectMetricsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } +func (*CollectMetricsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } func (m *CollectMetricsRequest) GetAllTags() map[string]*Map { if m != nil { @@ -325,7 +286,7 @@ type CollectMetricsResponse struct { func (m *CollectMetricsResponse) Reset() { *m = CollectMetricsResponse{} } func (m *CollectMetricsResponse) String() string { return proto.CompactTextString(m) } func (*CollectMetricsResponse) ProtoMessage() {} -func (*CollectMetricsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } +func (*CollectMetricsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } func (m *CollectMetricsResponse) GetMetrics() []*common.Metric { if m != nil { @@ -334,22 +295,6 @@ func (m *CollectMetricsResponse) GetMetrics() []*common.Metric { return nil } -type ExpandWildcardsRequest struct { - Namespace []*common.NamespaceElement `protobuf:"bytes,1,rep,name=Namespace,json=namespace" json:"Namespace,omitempty"` -} - -func (m *ExpandWildcardsRequest) Reset() { *m = ExpandWildcardsRequest{} } -func (m *ExpandWildcardsRequest) String() string { return proto.CompactTextString(m) } -func (*ExpandWildcardsRequest) ProtoMessage() {} -func (*ExpandWildcardsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } - -func (m *ExpandWildcardsRequest) GetNamespace() []*common.NamespaceElement { - if m != nil { - return m.Namespace - } - return nil -} - type ArrString struct { S []*common.NamespaceElement `protobuf:"bytes,1,rep,name=S,json=s" json:"S,omitempty"` } @@ -357,7 +302,7 @@ type ArrString struct { func (m *ArrString) Reset() { *m = ArrString{} } func (m *ArrString) String() string { return proto.CompactTextString(m) } func (*ArrString) ProtoMessage() {} -func (*ArrString) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } +func (*ArrString) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } func (m *ArrString) GetS() []*common.NamespaceElement { if m != nil { @@ -366,30 +311,6 @@ func (m *ArrString) GetS() []*common.NamespaceElement { return nil } -type ExpandWildcardsReply struct { - NSS []*ArrString `protobuf:"bytes,1,rep,name=NSS,json=nSS" json:"NSS,omitempty"` - Error *common.SnapError `protobuf:"bytes,2,opt,name=Error,json=error" json:"Error,omitempty"` -} - -func (m *ExpandWildcardsReply) Reset() { *m = ExpandWildcardsReply{} } -func (m *ExpandWildcardsReply) String() string { return proto.CompactTextString(m) } -func (*ExpandWildcardsReply) ProtoMessage() {} -func (*ExpandWildcardsReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } - -func (m *ExpandWildcardsReply) GetNSS() []*ArrString { - if m != nil { - return m.NSS - } - return nil -} - -func (m *ExpandWildcardsReply) GetError() *common.SnapError { - if m != nil { - return m.Error - } - return nil -} - type GetAutodiscoverPathsReply struct { Paths []string `protobuf:"bytes,1,rep,name=Paths,json=paths" json:"Paths,omitempty"` } @@ -397,15 +318,13 @@ type GetAutodiscoverPathsReply struct { func (m *GetAutodiscoverPathsReply) Reset() { *m = GetAutodiscoverPathsReply{} } func (m *GetAutodiscoverPathsReply) String() string { return proto.CompactTextString(m) } func (*GetAutodiscoverPathsReply) ProtoMessage() {} -func (*GetAutodiscoverPathsReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } +func (*GetAutodiscoverPathsReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } func init() { proto.RegisterType((*SerrorReply)(nil), "rpc.SerrorReply") proto.RegisterType((*PubProcMetricsRequest)(nil), "rpc.PubProcMetricsRequest") proto.RegisterType((*ErrorReply)(nil), "rpc.ErrorReply") proto.RegisterType((*ProcessMetricsReply)(nil), "rpc.ProcessMetricsReply") - proto.RegisterType((*GetPluginContentTypesRequest)(nil), "rpc.GetPluginContentTypesRequest") - proto.RegisterType((*GetPluginContentTypesReply)(nil), "rpc.GetPluginContentTypesReply") proto.RegisterType((*ValidateDepsRequest)(nil), "rpc.ValidateDepsRequest") proto.RegisterType((*ValidateDepsReply)(nil), "rpc.ValidateDepsReply") proto.RegisterType((*SubscribeDepsRequest)(nil), "rpc.SubscribeDepsRequest") @@ -416,9 +335,7 @@ func init() { proto.RegisterType((*MapEntry)(nil), "rpc.MapEntry") proto.RegisterType((*CollectMetricsRequest)(nil), "rpc.CollectMetricsRequest") proto.RegisterType((*CollectMetricsResponse)(nil), "rpc.CollectMetricsResponse") - proto.RegisterType((*ExpandWildcardsRequest)(nil), "rpc.ExpandWildcardsRequest") proto.RegisterType((*ArrString)(nil), "rpc.ArrString") - proto.RegisterType((*ExpandWildcardsReply)(nil), "rpc.ExpandWildcardsReply") proto.RegisterType((*GetAutodiscoverPathsReply)(nil), "rpc.GetAutodiscoverPathsReply") } @@ -434,11 +351,6 @@ const _ = grpc.SupportPackageIsVersion2 type MetricManagerClient interface { // managesMetrics from scheduler -<<<<<<< HEAD - GetPluginContentTypes(ctx context.Context, in *GetPluginContentTypesRequest, opts ...grpc.CallOption) (*GetPluginContentTypesReply, error) -======= - ExpandWildcards(ctx context.Context, in *ExpandWildcardsRequest, opts ...grpc.CallOption) (*ExpandWildcardsReply, error) ->>>>>>> Updates controlproxy to match new managesMetrics CollectMetrics(ctx context.Context, in *CollectMetricsRequest, opts ...grpc.CallOption) (*CollectMetricsResponse, error) PublishMetrics(ctx context.Context, in *PubProcMetricsRequest, opts ...grpc.CallOption) (*ErrorReply, error) ProcessMetrics(ctx context.Context, in *PubProcMetricsRequest, opts ...grpc.CallOption) (*ProcessMetricsReply, error) @@ -456,21 +368,6 @@ func NewMetricManagerClient(cc *grpc.ClientConn) MetricManagerClient { return &metricManagerClient{cc} } -<<<<<<< HEAD -func (c *metricManagerClient) GetPluginContentTypes(ctx context.Context, in *GetPluginContentTypesRequest, opts ...grpc.CallOption) (*GetPluginContentTypesReply, error) { - out := new(GetPluginContentTypesReply) - err := grpc.Invoke(ctx, "/rpc.MetricManager/GetPluginContentTypes", in, out, c.cc, opts...) -======= -func (c *metricManagerClient) ExpandWildcards(ctx context.Context, in *ExpandWildcardsRequest, opts ...grpc.CallOption) (*ExpandWildcardsReply, error) { - out := new(ExpandWildcardsReply) - err := grpc.Invoke(ctx, "/rpc.MetricManager/ExpandWildcards", in, out, c.cc, opts...) ->>>>>>> Updates controlproxy to match new managesMetrics - if err != nil { - return nil, err - } - return out, nil -} - func (c *metricManagerClient) CollectMetrics(ctx context.Context, in *CollectMetricsRequest, opts ...grpc.CallOption) (*CollectMetricsResponse, error) { out := new(CollectMetricsResponse) err := grpc.Invoke(ctx, "/rpc.MetricManager/CollectMetrics", in, out, c.cc, opts...) @@ -538,11 +435,6 @@ func (c *metricManagerClient) GetAutodiscoverPaths(ctx context.Context, in *comm type MetricManagerServer interface { // managesMetrics from scheduler -<<<<<<< HEAD - GetPluginContentTypes(context.Context, *GetPluginContentTypesRequest) (*GetPluginContentTypesReply, error) -======= - ExpandWildcards(context.Context, *ExpandWildcardsRequest) (*ExpandWildcardsReply, error) ->>>>>>> Updates controlproxy to match new managesMetrics CollectMetrics(context.Context, *CollectMetricsRequest) (*CollectMetricsResponse, error) PublishMetrics(context.Context, *PubProcMetricsRequest) (*ErrorReply, error) ProcessMetrics(context.Context, *PubProcMetricsRequest) (*ProcessMetricsReply, error) @@ -556,40 +448,6 @@ func RegisterMetricManagerServer(s *grpc.Server, srv MetricManagerServer) { s.RegisterService(&_MetricManager_serviceDesc, srv) } -<<<<<<< HEAD -func _MetricManager_GetPluginContentTypes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPluginContentTypesRequest) -======= -func _MetricManager_ExpandWildcards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ExpandWildcardsRequest) ->>>>>>> Updates controlproxy to match new managesMetrics - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { -<<<<<<< HEAD - return srv.(MetricManagerServer).GetPluginContentTypes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/rpc.MetricManager/GetPluginContentTypes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricManagerServer).GetPluginContentTypes(ctx, req.(*GetPluginContentTypesRequest)) -======= - return srv.(MetricManagerServer).ExpandWildcards(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/rpc.MetricManager/ExpandWildcards", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricManagerServer).ExpandWildcards(ctx, req.(*ExpandWildcardsRequest)) ->>>>>>> Updates controlproxy to match new managesMetrics - } - return interceptor(ctx, in, info, handler) -} - func _MetricManager_CollectMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CollectMetricsRequest) if err := dec(in); err != nil { @@ -721,15 +579,6 @@ var _MetricManager_serviceDesc = grpc.ServiceDesc{ HandlerType: (*MetricManagerServer)(nil), Methods: []grpc.MethodDesc{ { -<<<<<<< HEAD - MethodName: "GetPluginContentTypes", - Handler: _MetricManager_GetPluginContentTypes_Handler, -======= - MethodName: "ExpandWildcards", - Handler: _MetricManager_ExpandWildcards_Handler, ->>>>>>> Updates controlproxy to match new managesMetrics - }, - { MethodName: "CollectMetrics", Handler: _MetricManager_CollectMetrics_Handler, }, @@ -766,121 +615,52 @@ func init() { } var fileDescriptor0 = []byte{ -<<<<<<< HEAD - // 840 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x56, 0xdb, 0x4e, 0xf3, 0x46, - 0x10, 0x26, 0x31, 0x49, 0xc8, 0xe4, 0x80, 0x58, 0x42, 0x30, 0x06, 0x01, 0x71, 0xd5, 0x96, 0xb6, - 0x6a, 0x52, 0x05, 0xa9, 0xa5, 0xbd, 0x68, 0x95, 0x42, 0x44, 0x11, 0x02, 0xa5, 0x04, 0xa8, 0x7a, - 0xd1, 0x0b, 0xc7, 0xde, 0x06, 0x0b, 0xc7, 0x76, 0x77, 0xd7, 0x88, 0x3c, 0x4b, 0x1f, 0xb0, 0xaf, - 0xd1, 0x3d, 0xd8, 0xce, 0x01, 0x73, 0x90, 0xfe, 0xab, 0x78, 0x67, 0x66, 0xbf, 0xf9, 0xe6, 0xb8, - 0x81, 0x9f, 0xc7, 0x2e, 0x7b, 0x88, 0x46, 0x6d, 0x3b, 0x98, 0x74, 0x5c, 0x9f, 0x61, 0x8f, 0x3a, - 0xee, 0xb7, 0xcf, 0x1d, 0xea, 0x5b, 0x61, 0x67, 0x4c, 0x42, 0xbb, 0x63, 0x07, 0x3e, 0x23, 0x81, - 0x17, 0x92, 0xe0, 0x79, 0xda, 0x99, 0x13, 0xb4, 0xb9, 0x84, 0x05, 0x48, 0xe3, 0x22, 0xe3, 0xf8, - 0x7d, 0x90, 0xc9, 0x24, 0xf0, 0xe3, 0x1f, 0x75, 0xd3, 0xac, 0x41, 0x65, 0x88, 0x09, 0x09, 0xc8, - 0x0d, 0x0e, 0xbd, 0xa9, 0xf9, 0x6f, 0x0e, 0xb6, 0x06, 0xd1, 0x68, 0x40, 0x02, 0xfb, 0x0a, 0x33, - 0xe2, 0xda, 0xf4, 0x06, 0xff, 0x13, 0x61, 0xca, 0xd0, 0x26, 0x54, 0x4e, 0xb9, 0x4f, 0xec, 0xb3, - 0xdb, 0x69, 0x88, 0xf5, 0xdc, 0x61, 0xee, 0xa8, 0x8c, 0xd6, 0xa1, 0x14, 0x0b, 0xf5, 0x3c, 0x17, - 0x54, 0x11, 0x02, 0x18, 0x78, 0xd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58, 0x58, 0xee, 0x6f, 0x02, 0xe8, 0x4a, 0xf7, 0xf2, 0x35, - 0xe0, 0x48, 0xbf, 0x42, 0x75, 0x7e, 0x91, 0x21, 0x65, 0x9b, 0xb1, 0x3e, 0x8d, 0x66, 0x86, 0x46, - 0x61, 0xf4, 0xa1, 0xb6, 0xb0, 0x5e, 0xd0, 0x8e, 0x34, 0xcd, 0x5a, 0x74, 0xc6, 0x76, 0x96, 0x2a, - 0x49, 0xf1, 0xfa, 0xd2, 0x0a, 0x41, 0x2a, 0x8f, 0xd9, 0x2b, 0xc8, 0xd8, 0xc9, 0x56, 0x2a, 0xb0, - 0x73, 0x68, 0x64, 0x35, 0x13, 0xaa, 0x25, 0x7d, 0xd7, 0x9f, 0x84, 0x6c, 0x6a, 0xec, 0x27, 0x95, - 0xcf, 0x6e, 0x3b, 0x73, 0x65, 0x54, 0x94, 0xff, 0x0c, 0x8e, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, - 0x4e, 0xc0, 0x13, 0x3e, 0x95, 0x08, 0x00, 0x00, -======= - // 939 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x56, 0x4d, 0x6f, 0xdb, 0x46, - 0x10, 0xb5, 0x44, 0x4b, 0xb2, 0x46, 0xa6, 0xdd, 0x6c, 0x1c, 0x55, 0x61, 0x0a, 0xc3, 0x20, 0x82, - 0xc6, 0x39, 0x54, 0x42, 0x65, 0xa0, 0x28, 0x7a, 0x48, 0xa0, 0x46, 0x82, 0x5b, 0x04, 0x0e, 0x54, - 0x52, 0x4d, 0x80, 0xde, 0x56, 0xe4, 0x56, 0x26, 0x4c, 0x2d, 0x59, 0xee, 0x32, 0xb0, 0x2e, 0x3d, - 0xf4, 0xdc, 0xbf, 0xd1, 0x3f, 0xd3, 0x5f, 0xd5, 0xfd, 0x20, 0x69, 0x52, 0xa1, 0xeb, 0x36, 0xf1, - 0xc9, 0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0xfa, 0xd1, 0x1f, 0xb4, 0xd4, 0x66, 0x6d, - 0xae, 0x56, 0xf6, 0x53, 0x80, 0x59, 0x41, 0x4d, 0x56, 0xa9, 0x95, 0xee, 0x5f, 0x54, 0x29, 0xda, - 0xcc, 0x7e, 0x07, 0x0f, 0x25, 0x5d, 0xc2, 0x58, 0xc1, 0x58, 0x96, 0xff, 0x77, 0xbe, 0x37, 0xc0, - 0xcd, 0x0a, 0x70, 0x08, 0x5f, 0x9c, 0x13, 0xae, 0xa9, 0x8a, 0xa6, 0x39, 0xa1, 0x7c, 0xb1, 0x89, - 0x49, 0xa1, 0x28, 0x82, 0x5d, 0xa5, 0x50, 0x43, 0x35, 0xbd, 0x4b, 0xa5, 0x36, 0x85, 0x76, 0xb2, - 0x52, 0x69, 0xd7, 0xca, 0xb5, 0x93, 0x11, 0x34, 0x80, 0x4e, 0x59, 0xb5, 0x96, 0xd3, 0x79, 0xaf, - 0x97, 0xf6, 0xef, 0x60, 0xdd, 0xb2, 0x9b, 0x64, 0x23, 0x34, 0x9f, 0x78, 0x1e, 0x89, 0x39, 0xf1, - 0x55, 0x34, 0xd3, 0xc0, 0xc4, 0xe5, 0xa0, 0xac, 0x72, 0x08, 0x4f, 0x13, 0x9a, 0x57, 0x69, 0x42, - 0x66, 0x52, 0x0e, 0xa2, 0x23, 0x68, 0x29, 0xbe, 0xaa, 0x83, 0xae, 0xd3, 0x52, 0x74, 0x6d, 0x06, - 0x0f, 0xdf, 0xe2, 0x30, 0xf0, 0x31, 0x27, 0x53, 0x12, 0x7f, 0x84, 0x6d, 0xc6, 0xd0, 0xd1, 0xdd, - 0xeb, 0x6d, 0x7b, 0xe3, 0x41, 0x5e, 0xe9, 0xa6, 0x4b, 0xe6, 0x25, 0xc1, 0x92, 0xf8, 0xba, 0xc0, - 0xe9, 0x68, 0x45, 0x98, 0xfd, 0x02, 0x1e, 0x54, 0x37, 0x95, 0x5c, 0x9f, 0x57, 0x0e, 0xba, 0xe4, - 0x1c, 0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, 0xd2, 0x30, 0x60, - 0x97, 0x55, 0xb0, 0xda, 0x07, 0xd6, 0x3a, 0xd4, 0x7d, 0xdd, 0xbc, 0xc5, 0x3b, 0xe8, 0x07, 0x01, - 0x50, 0x79, 0x9a, 0xfe, 0x15, 0x60, 0xa0, 0x73, 0x1f, 0xbe, 0x65, 0x02, 0xe9, 0x7b, 0xd8, 0x2f, - 0x0f, 0x4a, 0xa4, 0x6b, 0x6b, 0x06, 0xb6, 0xd5, 0xaf, 0xc9, 0x68, 0x8c, 0x19, 0x98, 0x95, 0x39, - 0x85, 0xb4, 0x92, 0x75, 0xf3, 0xd3, 0xfa, 0xbc, 0x2e, 0xa5, 0x61, 0xce, 0xe1, 0xf0, 0x67, 0xca, - 0xee, 0x01, 0xc8, 0x81, 0xfe, 0x05, 0xe6, 0xde, 0xe5, 0x4f, 0x29, 0x49, 0x36, 0x8b, 0xa8, 0xf0, - 0xf0, 0xa7, 0x9c, 0xff, 0x39, 0x1c, 0xd5, 0x39, 0x12, 0x99, 0xb9, 0x87, 0x67, 0xeb, 0x98, 0x6f, - 0xac, 0x63, 0x85, 0x71, 0xab, 0x77, 0xed, 0x9d, 0x65, 0x5b, 0xfd, 0xbc, 0x3a, 0xfb, 0x27, 0x00, - 0x00, 0xff, 0xff, 0xc3, 0x7f, 0x4d, 0x86, 0xda, 0x09, 0x00, 0x00, ->>>>>>> Updates controlproxy to match new managesMetrics + // 746 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x55, 0xc1, 0x4e, 0xdb, 0x4c, + 0x10, 0xc6, 0x98, 0x24, 0x64, 0x42, 0xe0, 0x67, 0xc9, 0x9f, 0x06, 0x57, 0x42, 0xc8, 0x42, 0x05, + 0xa4, 0xd6, 0x69, 0xcd, 0xa5, 0xea, 0x01, 0x94, 0x92, 0x88, 0x56, 0x88, 0x2a, 0x72, 0x28, 0x95, + 0x7a, 0x73, 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xb7, 0x25, 0x68, 0x0a, 0x4e, 0x67, 0xa6, 0x6f, 0xda, 0x98, 0xa2, + 0x53, 0x58, 0x2d, 0xaa, 0x42, 0xca, 0xfd, 0xf5, 0x55, 0x9e, 0x96, 0xfa, 0x44, 0x19, 0xd4, 0x05, + 0x74, 0x04, 0xab, 0x7c, 0x15, 0xbb, 0x0e, 0xbb, 0x2c, 0x82, 0x95, 0xee, 0x67, 0x65, 0x2d, 0xf1, + 0xdd, 0xee, 0x3b, 0x0e, 0xf0, 0x8e, 0x03, 0x14, 0x36, 0xdb, 0x6f, 0x01, 0x3a, 0xc2, 0x77, 0x77, + 0x15, 0x72, 0xa4, 0xb7, 0xb0, 0x92, 0xdf, 0x2a, 0x48, 0xc4, 0x96, 0x6c, 0x37, 0xa5, 0x5d, 0xe2, + 0x11, 0x18, 0x03, 0x68, 0x16, 0xc6, 0x18, 0x6d, 0x26, 0xa1, 0x65, 0xcb, 0x46, 0x79, 0x52, 0xe6, + 0x12, 0x30, 0xa7, 0xb0, 0x36, 0x37, 0x9a, 0x48, 0xd4, 0xb1, 0x7c, 0xc4, 0x95, 0xcd, 0x72, 0xa7, + 0x00, 0x3b, 0x81, 0x56, 0x59, 0xd3, 0x51, 0x33, 0x7b, 0x29, 0x03, 0x2f, 0x08, 0xa7, 0xca, 0x56, + 0x82, 0x71, 0xef, 0xf3, 0x50, 0x17, 0xc6, 0xd5, 0xe4, 0xdf, 0xf4, 0xe0, 0x57, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x1b, 0x5c, 0xfe, 0x59, 0xc9, 0x07, 0x00, 0x00, } diff --git a/scheduler/job.go b/scheduler/job.go index 3de632c1e..a77405c2d 100644 --- a/scheduler/job.go +++ b/scheduler/job.go @@ -20,15 +20,11 @@ limitations under the License. package scheduler import ( - "bytes" - "encoding/gob" - "fmt" "sync" "time" log "github.com/Sirupsen/logrus" - "github.com/intelsdi-x/snap/control/plugin" "github.com/intelsdi-x/snap/core" "github.com/intelsdi-x/snap/core/cdata" "github.com/intelsdi-x/snap/core/ctypes" @@ -91,6 +87,7 @@ type job interface { TypeString() string TaskID() string Run() + Metrics() []core.Metric } type jobType int @@ -218,6 +215,10 @@ func (m *metric) Tags() map[string]string { return nil } func (m *metric) LastAdvertisedTime() time.Time { return time.Unix(0, 0) } func (m *metric) Timestamp() time.Time { return time.Unix(0, 0) } +func (c *collectorJob) Metrics() []core.Metric { + return c.metrics +} + func (c *collectorJob) Run() { log.WithFields(log.Fields{ "_module": "scheduler-job", @@ -264,22 +265,23 @@ func (c *collectorJob) Run() { type processJob struct { *coreJob - processor processesMetrics - parentJob job - metrics []core.Metric - config map[string]ctypes.ConfigValue - contentType string - content []byte + processor processesMetrics + parentJob job + metrics []core.Metric + config map[string]ctypes.ConfigValue +} + +func (pr *processJob) Metrics() []core.Metric { + return pr.metrics } func newProcessJob(parentJob job, pluginName string, pluginVersion int, contentType string, config map[string]ctypes.ConfigValue, processor processesMetrics, taskID string) job { return &processJob{ - parentJob: parentJob, - metrics: []core.Metric{}, - coreJob: newCoreJob(processJobType, parentJob.Deadline(), taskID, pluginName, pluginVersion), - config: config, - processor: processor, - contentType: contentType, + parentJob: parentJob, + metrics: []core.Metric{}, + coreJob: newCoreJob(processJobType, parentJob.Deadline(), taskID, pluginName, pluginVersion), + config: config, + processor: processor, } } @@ -288,142 +290,46 @@ func (p *processJob) Run() { "_module": "scheduler-job", "block": "run", "job-type": "processor", - "content-type": p.contentType, "plugin-name": p.name, "plugin-version": p.version, "plugin-config": p.config, }).Debug("starting processor job") - var buf bytes.Buffer - enc := gob.NewEncoder(&buf) - - switch pt := p.parentJob.(type) { - case *collectorJob: - switch p.contentType { - case plugin.SnapGOBContentType: - metrics := make([]plugin.MetricType, len(pt.metrics)) - for i, m := range pt.metrics { - if mt, ok := m.(plugin.MetricType); ok { - metrics[i] = mt - } else { - log.WithFields(log.Fields{ - "_module": "scheduler-job", - "block": "run", - "job-type": "processor", - "content-type": p.contentType, - "plugin-name": p.name, - "plugin-version": p.version, - "plugin-config": p.config, - "error": m, - }).Error("unsupported metric type") - p.AddErrors(fmt.Errorf("unsupported metric type. {%v}", m)) - } - } - err := enc.Encode(metrics) - if err != nil { - log.WithFields(log.Fields{ - "_module": "scheduler-job", - "block": "run", - "job-type": "processor", - "plugin-name": p.name, - "plugin-version": p.version, - "error": err, - }).Error("encoding error") - } - _, content, errs := p.processor.ProcessMetrics(p.contentType, buf.Bytes(), p.name, p.version, p.config, p.taskID) - if errs != nil { - for _, e := range errs { - log.WithFields(log.Fields{ - "_module": "scheduler-job", - "block": "run", - "job-type": "processor", - "content-type": p.contentType, - "plugin-name": p.name, - "plugin-version": p.version, - "plugin-config": p.config, - "error": e.Error(), - }).Error("error with processor job") - } - p.AddErrors(errs...) - } - p.content = content - default: - log.WithFields(log.Fields{ - "_module": "scheduler-job", - "block": "run", - "job-type": "processor", - "content-type": p.contentType, - "plugin-name": p.name, - "plugin-version": p.version, - "plugin-config": p.config, - }).Error("unsupported content type") - p.AddErrors(fmt.Errorf("unsupported content type. {plugin name: %s version: %v content-type: '%v'}", p.name, p.version, p.contentType)) - } - - case *processJob: - // TODO: Remove switch statement and rely on processor to catch errors in type - // (separation of concerns; remove content-type definition from the framework?) - switch p.contentType { - case plugin.SnapGOBContentType: - _, content, errs := p.processor.ProcessMetrics(p.contentType, pt.content, p.name, p.version, p.config, p.taskID) - if errs != nil { - for _, e := range errs { - log.WithFields(log.Fields{ - "_module": "scheduler-job", - "block": "run", - "job-type": "processor", - "content-type": p.contentType, - "plugin-name": p.name, - "plugin-version": p.version, - "plugin-config": p.config, - "error": e.Error(), - }).Error("error with processor job") - } - p.AddErrors(errs...) - } - p.content = content - default: + mts, errs := p.processor.ProcessMetrics(p.parentJob.Metrics(), p.config, p.taskID, p.name, p.version) + if errs != nil { + for _, e := range errs { log.WithFields(log.Fields{ "_module": "scheduler-job", "block": "run", "job-type": "processor", - "content-type": p.contentType, "plugin-name": p.name, "plugin-version": p.version, "plugin-config": p.config, - }).Error("unsupported content type") - p.AddErrors(fmt.Errorf("unsupported content type. {plugin name: %s version: %v content-type: '%v'}", p.name, p.version, p.contentType)) + "error": e.Error(), + }).Error("error with processor job") } - default: - log.WithFields(log.Fields{ - "_module": "scheduler-job", - "block": "run", - "job-type": "processor", - "content-type": p.contentType, - "plugin-name": p.name, - "plugin-version": p.version, - "plugin-config": p.config, - "parent-job-type": p.parentJob.Type(), - }).Error("unsupported parent job type") - p.AddErrors(fmt.Errorf("unsupported parent job type {%v}", p.parentJob.Type())) + p.AddErrors(errs...) } + p.metrics = mts } type publisherJob struct { *coreJob - parentJob job - publisher publishesMetrics - config map[string]ctypes.ConfigValue - contentType string + parentJob job + publisher publishesMetrics + config map[string]ctypes.ConfigValue +} + +func (pu *publisherJob) Metrics() []core.Metric { + return []core.Metric{} } func newPublishJob(parentJob job, pluginName string, pluginVersion int, contentType string, config map[string]ctypes.ConfigValue, publisher publishesMetrics, taskID string) job { return &publisherJob{ - parentJob: parentJob, - publisher: publisher, - coreJob: newCoreJob(publishJobType, parentJob.Deadline(), taskID, pluginName, pluginVersion), - config: config, - contentType: contentType, + parentJob: parentJob, + publisher: publisher, + coreJob: newCoreJob(publishJobType, parentJob.Deadline(), taskID, pluginName, pluginVersion), + config: config, } } @@ -432,99 +338,24 @@ func (p *publisherJob) Run() { "_module": "scheduler-job", "block": "run", "job-type": "publisher", - "content-type": p.contentType, "plugin-name": p.name, "plugin-version": p.version, "plugin-config": p.config, }).Debug("starting publisher job") - var buf bytes.Buffer - enc := gob.NewEncoder(&buf) - switch p.parentJob.Type() { - case collectJobType: - switch p.contentType { - case plugin.SnapGOBContentType: - metrics := make([]plugin.MetricType, len(p.parentJob.(*collectorJob).metrics)) - for i, m := range p.parentJob.(*collectorJob).metrics { - switch mt := m.(type) { - case plugin.MetricType: - metrics[i] = mt - default: - panic(fmt.Sprintf("unsupported type %T", mt)) - } - } - err := enc.Encode(metrics) - if err != nil { - log.WithFields(log.Fields{ - "_module": "scheduler-job", - "block": "run", - "job-type": "publisher", - "plugin-name": p.name, - "plugin-version": p.version, - "error": err, - }).Error("encoding error") - } - errs := p.publisher.PublishMetrics(p.contentType, buf.Bytes(), p.name, p.version, p.config, p.taskID) - if errs != nil { - for _, e := range errs { - log.WithFields(log.Fields{ - "_module": "scheduler-job", - "block": "run", - "job-type": "publisher", - "content-type": p.contentType, - "plugin-name": p.name, - "plugin-version": p.version, - "plugin-config": p.config, - "error": e.Error(), - }).Error("error with publisher job") - } - p.AddErrors(errs...) - } - default: + errs := p.publisher.PublishMetrics(p.parentJob.Metrics(), p.config, p.taskID, p.name, p.version) + if errs != nil { + for _, e := range errs { log.WithFields(log.Fields{ "_module": "scheduler-job", "block": "run", "job-type": "publisher", - "content-type": p.contentType, "plugin-name": p.name, "plugin-version": p.version, "plugin-config": p.config, - }).Fatal("unsupported content type") - panic(fmt.Sprintf("unsupported content type. {plugin name: %s version: %v content-type: '%v'}", p.name, p.version, p.contentType)) - } - case processJobType: - // TODO: Remove switch statement and rely on publisher to catch errors in type - // (separation of concerns; remove content-type definition from the framework?) - switch p.contentType { - case plugin.SnapGOBContentType: - errs := p.publisher.PublishMetrics(p.contentType, p.parentJob.(*processJob).content, p.name, p.version, p.config, p.taskID) - if errs != nil { - for _, e := range errs { - log.WithFields(log.Fields{ - "_module": "scheduler-job", - "block": "run", - "job-type": "publisher", - "content-type": p.contentType, - "plugin-name": p.name, - "plugin-version": p.version, - "plugin-config": p.config, - "error": e.Error(), - }).Error("error with publisher job") - } - p.AddErrors(errs...) - } + "error": e.Error(), + }).Error("error with publisher job") } - default: - log.WithFields(log.Fields{ - "_module": "scheduler-job", - "block": "run", - "job-type": "publisher", - "content-type": p.contentType, - "plugin-name": p.name, - "plugin-version": p.version, - "plugin-config": p.config, - "parent-job-type": p.parentJob.Type(), - }).Fatal("unsupported parent job type") - panic("unsupported job type") + p.AddErrors(errs...) } } diff --git a/scheduler/scheduler.go b/scheduler/scheduler.go index f38aee56b..ba39afa7b 100644 --- a/scheduler/scheduler.go +++ b/scheduler/scheduler.go @@ -88,28 +88,24 @@ type managesMetrics interface { collectsMetrics publishesMetrics processesMetrics - managesPluginContentTypes GetAutodiscoverPaths() []string ValidateDeps([]core.RequestedMetric, []core.SubscribedPlugin, *cdata.ConfigDataTree) []serror.SnapError SubscribeDeps(string, []core.RequestedMetric, []core.SubscribedPlugin, *cdata.ConfigDataTree) []serror.SnapError UnsubscribeDeps(string) []serror.SnapError } -// ManagesPluginContentTypes is an interface to a plugin manager that can tell us what content accept and returns are supported. -type managesPluginContentTypes interface { - GetPluginContentTypes(n string, t core.PluginType, v int) ([]string, []string, error) -} - type collectsMetrics interface { CollectMetrics(string, map[string]map[string]string) ([]core.Metric, []error) } type publishesMetrics interface { - PublishMetrics(contentType string, content []byte, pluginName string, pluginVersion int, config map[string]ctypes.ConfigValue, taskID string) []error + PublishMetrics([]core.Metric, map[string]ctypes.ConfigValue, string, string, int) []error + //PublishMetrics(contentType string, content []byte, pluginName string, pluginVersion int, config map[string]ctypes.ConfigValue, taskID string) []error } type processesMetrics interface { - ProcessMetrics(contentType string, content []byte, pluginName string, pluginVersion int, config map[string]ctypes.ConfigValue, taskID string) (string, []byte, []error) + ProcessMetrics([]core.Metric, map[string]ctypes.ConfigValue, string, string, int) ([]core.Metric, []error) + //ProcessMetrics(contentType string, content []byte, pluginName string, pluginVersion int, config map[string]ctypes.ConfigValue, taskID string) (string, []byte, []error) } type scheduler struct { @@ -353,15 +349,6 @@ func (s *scheduler) createTask(sch schedule.Schedule, wfMap *wmap.WorkflowMap, s } } - // Bind plugin content type selections in workflow - err = wf.BindPluginContentTypes(&task.RemoteManagers) - if err != nil { - te.errs = append(te.errs, serror.New(err)) - f := buildErrorsLog(te.Errors(), logger) - f.Error("unable to bind plugin content types") - return nil, te - } - // Add task to taskCollection if err := s.tasks.add(task); err != nil { te.errs = append(te.errs, serror.New(err)) diff --git a/scheduler/scheduler_medium_test.go b/scheduler/scheduler_medium_test.go index 2be0bcfed..cc1212e4c 100644 --- a/scheduler/scheduler_medium_test.go +++ b/scheduler/scheduler_medium_test.go @@ -23,7 +23,6 @@ package scheduler import ( "errors" - "fmt" "testing" "time" @@ -42,56 +41,19 @@ type mockMetricManager struct { failValidatingMetrics bool failValidatingMetricsAfter int failuredSoFar int - acceptedContentTypes map[string][]string - returnedContentTypes map[string][]string autodiscoverPaths []string } -func (m *mockMetricManager) lazyContentType(key string) { - if m.acceptedContentTypes == nil { - m.acceptedContentTypes = make(map[string][]string) - } - if m.returnedContentTypes == nil { - m.returnedContentTypes = make(map[string][]string) - } - if m.acceptedContentTypes[key] == nil { - m.acceptedContentTypes[key] = []string{"snap.gob"} - } - if m.returnedContentTypes[key] == nil { - m.returnedContentTypes[key] = []string{} - } -} - -// Used to mock type from plugin -func (m *mockMetricManager) setAcceptedContentType(n string, t core.PluginType, v int, s []string) { - key := fmt.Sprintf("%s:%d:%d", n, t, v) - m.lazyContentType(key) - m.acceptedContentTypes[key] = s -} - -func (m *mockMetricManager) setReturnedContentType(n string, t core.PluginType, v int, s []string) { - key := fmt.Sprintf("%s:%d:%d", n, t, v) - m.lazyContentType(key) - m.returnedContentTypes[key] = s -} - -func (m *mockMetricManager) GetPluginContentTypes(n string, t core.PluginType, v int) ([]string, []string, error) { - key := fmt.Sprintf("%s:%d:%d", n, t, v) - m.lazyContentType(key) - - return m.acceptedContentTypes[key], m.returnedContentTypes[key], nil -} - func (m *mockMetricManager) CollectMetrics(string, map[string]map[string]string) ([]core.Metric, []error) { return nil, nil } -func (m *mockMetricManager) PublishMetrics(contentType string, content []byte, pluginName string, pluginVersion int, config map[string]ctypes.ConfigValue, taskID string) []error { +func (m *mockMetricManager) PublishMetrics([]core.Metric, map[string]ctypes.ConfigValue, string, string, int) []error { return nil } -func (m *mockMetricManager) ProcessMetrics(contentType string, content []byte, pluginName string, pluginVersion int, config map[string]ctypes.ConfigValue, taskID string) (string, []byte, []error) { - return "", nil, nil +func (m *mockMetricManager) ProcessMetrics([]core.Metric, map[string]ctypes.ConfigValue, string, string, int) ([]core.Metric, []error) { + return nil, nil } func (m *mockMetricManager) ValidateDeps(mts []core.RequestedMetric, prs []core.SubscribedPlugin, ctree *cdata.ConfigDataTree) []serror.SnapError { @@ -169,10 +131,6 @@ func (m mockScheduleResponse) missedIntervals() uint { // Helper constructor functions for resuse amongst tests func newMockMetricManager() *mockMetricManager { m := new(mockMetricManager) - m.setAcceptedContentType("machine", core.ProcessorPluginType, 1, []string{"snap.*", "snap.gob", "foo.bar"}) - m.setReturnedContentType("machine", core.ProcessorPluginType, 1, []string{"snap.gob"}) - m.setAcceptedContentType("rmq", core.PublisherPluginType, -1, []string{"snap.json", "snap.gob"}) - m.setAcceptedContentType("file", core.PublisherPluginType, -1, []string{"snap.json"}) return m } diff --git a/scheduler/scheduler_test.go b/scheduler/scheduler_test.go index 591078cce..1a67d2e57 100644 --- a/scheduler/scheduler_test.go +++ b/scheduler/scheduler_test.go @@ -44,56 +44,19 @@ type mockMetricManager struct { failValidatingMetrics bool failValidatingMetricsAfter int failuredSoFar int - acceptedContentTypes map[string][]string - returnedContentTypes map[string][]string autodiscoverPaths []string } -func (m *mockMetricManager) lazyContentType(key string) { - if m.acceptedContentTypes == nil { - m.acceptedContentTypes = make(map[string][]string) - } - if m.returnedContentTypes == nil { - m.returnedContentTypes = make(map[string][]string) - } - if m.acceptedContentTypes[key] == nil { - m.acceptedContentTypes[key] = []string{"snap.gob"} - } - if m.returnedContentTypes[key] == nil { - m.returnedContentTypes[key] = []string{} - } -} - -// Used to mock type from plugin -func (m *mockMetricManager) setAcceptedContentType(n string, t core.PluginType, v int, s []string) { - key := fmt.Sprintf("%s:%d:%d", n, t, v) - m.lazyContentType(key) - m.acceptedContentTypes[key] = s -} - -func (m *mockMetricManager) setReturnedContentType(n string, t core.PluginType, v int, s []string) { - key := fmt.Sprintf("%s:%d:%d", n, t, v) - m.lazyContentType(key) - m.returnedContentTypes[key] = s -} - -func (m *mockMetricManager) GetPluginContentTypes(n string, t core.PluginType, v int) ([]string, []string, error) { - key := fmt.Sprintf("%s:%d:%d", n, t, v) - m.lazyContentType(key) - - return m.acceptedContentTypes[key], m.returnedContentTypes[key], nil -} - func (m *mockMetricManager) CollectMetrics(string, map[string]map[string]string) ([]core.Metric, []error) { return nil, nil } -func (m *mockMetricManager) PublishMetrics(contentType string, content []byte, pluginName string, pluginVersion int, config map[string]ctypes.ConfigValue, taskID string) []error { +func (m *mockMetricManager) PublishMetrics([]core.Metric, map[string]ctypes.ConfigValue, string, string, int) []error { return nil } -func (m *mockMetricManager) ProcessMetrics(contentType string, content []byte, pluginName string, pluginVersion int, config map[string]ctypes.ConfigValue, taskID string) (string, []byte, []error) { - return "", nil, nil +func (m *mockMetricManager) ProcessMetrics([]core.Metric, map[string]ctypes.ConfigValue, string, string, int) ([]core.Metric, []error) { + return nil, nil } func (m *mockMetricManager) ValidateDeps(mts []core.RequestedMetric, prs []core.SubscribedPlugin, cdt *cdata.ConfigDataTree) []serror.SnapError { if m.failValidatingMetrics { @@ -192,10 +155,6 @@ func TestScheduler(t *testing.T) { log.SetLevel(log.FatalLevel) Convey("NewTask", t, func() { c := new(mockMetricManager) - c.setAcceptedContentType("machine", core.ProcessorPluginType, 1, []string{"snap.*", "snap.gob", "foo.bar"}) - c.setReturnedContentType("machine", core.ProcessorPluginType, 1, []string{"snap.gob"}) - c.setAcceptedContentType("rmq", core.PublisherPluginType, -1, []string{"snap.json", "snap.gob"}) - c.setAcceptedContentType("mock-file", core.PublisherPluginType, -1, []string{"snap.json"}) cfg := GetDefaultConfig() s := New(cfg) s.SetMetricManager(c) @@ -235,17 +194,9 @@ func TestScheduler(t *testing.T) { e := s.Start() So(e, ShouldBeNil) - t, te := s.CreateTask(schedule.NewSimpleSchedule(time.Second*1), w, false) + _, te := s.CreateTask(schedule.NewSimpleSchedule(time.Second*1), w, false) So(te.Errors(), ShouldBeEmpty) - for _, i := range t.(*task).workflow.processNodes { - testInboundContentType(i) - } - for _, i := range t.(*task).workflow.publishNodes { - testInboundContentType(i) - } - So(t.(*task).workflow.processNodes[0].ProcessNodes[0].PublishNodes[0].InboundContentType, ShouldEqual, "snap.json") - Convey("returns errors when metrics do not validate", func() { c.failValidatingMetrics = true c.failValidatingMetricsAfter = 1 @@ -381,17 +332,3 @@ func TestScheduler(t *testing.T) { }) } - -func testInboundContentType(node interface{}) { - switch t := node.(type) { - case *processNode: - fmt.Printf("testing content type for pr plugin %s %d/n", t.Name(), t.Version()) - So(t.InboundContentType, ShouldNotEqual, "") - for _, i := range t.ProcessNodes { - testInboundContentType(i) - } - case *publishNode: - fmt.Printf("testing content type for pu plugin %s %d/n", t.Name(), t.Version()) - So(t.InboundContentType, ShouldNotEqual, "") - } -} diff --git a/scheduler/task_test.go b/scheduler/task_test.go index a22688e97..9e0cdfa9d 100644 --- a/scheduler/task_test.go +++ b/scheduler/task_test.go @@ -25,7 +25,6 @@ import ( "testing" "time" - "github.com/intelsdi-x/snap/control/plugin" "github.com/intelsdi-x/snap/core" "github.com/intelsdi-x/snap/pkg/schedule" "github.com/intelsdi-x/snap/scheduler/wmap" @@ -46,10 +45,6 @@ func TestTask(t *testing.T) { wf, errs := wmapToWorkflow(sampleWFMap) So(errs, ShouldBeEmpty) c := &mockMetricManager{} - c.setAcceptedContentType("rabbitmq", core.PublisherPluginType, 5, []string{plugin.SnapGOBContentType}) - mgrs := newManagers(c) - err := wf.BindPluginContentTypes(&mgrs) - So(err, ShouldBeNil) Convey("task + simple schedule", func() { sch := schedule.NewSimpleSchedule(time.Millisecond * 100) task, err := newTask(sch, wf, newWorkManager(), c, emitter) diff --git a/scheduler/work_manager_test.go b/scheduler/work_manager_test.go index 680f66b83..85f251a38 100644 --- a/scheduler/work_manager_test.go +++ b/scheduler/work_manager_test.go @@ -27,6 +27,7 @@ import ( "time" log "github.com/Sirupsen/logrus" + "github.com/intelsdi-x/snap/core" . "github.com/intelsdi-x/snap/pkg/promise" . "github.com/smartystreets/goconvey/convey" ) @@ -117,6 +118,10 @@ func (mj *mockJob) Version() int { return 0 } +func (mj *mockJob) Metrics() []core.Metric { + return nil +} + func TestWorkerManager(t *testing.T) { log.SetLevel(log.FatalLevel) Convey(".Work()", t, func() { diff --git a/scheduler/workflow.go b/scheduler/workflow.go index 45b44580a..ff8773399 100644 --- a/scheduler/workflow.go +++ b/scheduler/workflow.go @@ -27,7 +27,6 @@ import ( log "github.com/Sirupsen/logrus" "github.com/intelsdi-x/gomit" - "github.com/intelsdi-x/snap/control/plugin" "github.com/intelsdi-x/snap/core" "github.com/intelsdi-x/snap/core/cdata" "github.com/intelsdi-x/snap/core/scheduler_event" @@ -236,86 +235,6 @@ func (p *publishNode) TypeName() string { type wfContentTypes map[string]map[string][]string -// BindPluginContentTypes -func (s *schedulerWorkflow) BindPluginContentTypes(mgrs *managers) error { - return bindPluginContentTypes(s.publishNodes, s.processNodes, []string{plugin.SnapGOBContentType}, mgrs) -} - -func bindPluginContentTypes(pus []*publishNode, prs []*processNode, lct []string, mgrs *managers) error { - for _, pr := range prs { - mm, err := mgrs.Get(pr.Target) - if err != nil { - return err - } - act, rct, err := mm.GetPluginContentTypes(pr.Name(), core.ProcessorPluginType, pr.Version()) - if err != nil { - return err - } - - for _, ac := range act { - for _, lc := range lct { - // if the return contenet type from the previous node matches - // the accept content type for this node set it as the - // inbound content type - if ac == lc { - pr.InboundContentType = ac - } - } - } - // if the inbound content type isn't set yet snap may be able to do - // the conversion - if pr.InboundContentType == "" { - for _, ac := range act { - switch ac { - case plugin.SnapGOBContentType: - pr.InboundContentType = plugin.SnapGOBContentType - case plugin.SnapJSONContentType: - pr.InboundContentType = plugin.SnapJSONContentType - case plugin.SnapAllContentType: - pr.InboundContentType = plugin.SnapGOBContentType - } - } - // else we return an error - if pr.InboundContentType == "" { - return fmt.Errorf("Invalid workflow. Plugin '%s' does not accept the snap content types or the types '%v' returned from the previous node.", pr.Name(), lct) - } - } - //continue the walk down the nodes - if err := bindPluginContentTypes(pr.PublishNodes, pr.ProcessNodes, rct, mgrs); err != nil { - return err - } - } - for _, pu := range pus { - mm, err := mgrs.Get(pu.Target) - if err != nil { - return err - } - act, _, err := mm.GetPluginContentTypes(pu.Name(), core.PublisherPluginType, pu.Version()) - if err != nil { - return err - } - // if the inbound content type isn't set yet snap may be able to do - // the conversion - if pu.InboundContentType == "" { - for _, ac := range act { - switch ac { - case plugin.SnapGOBContentType: - pu.InboundContentType = plugin.SnapGOBContentType - case plugin.SnapJSONContentType: - pu.InboundContentType = plugin.SnapJSONContentType - case plugin.SnapAllContentType: - pu.InboundContentType = plugin.SnapGOBContentType - } - } - // else we return an error - if pu.InboundContentType == "" { - return fmt.Errorf("Invalid workflow. Plugin '%s' does not accept the snap content types or the types '%v' returned from the previous node.", pu.Name(), lct) - } - } - } - return nil -} - // Start starts a workflow func (s *schedulerWorkflow) Start(t *task) { workflowLogger.WithFields(log.Fields{