Exemplo n.º 1
0
        internal static unsafe ServiceGroupMemberType CreateFromNative(
            NativeTypes.FABRIC_SERVICE_GROUP_MEMBER_TYPE_QUERY_RESULT_ITEM nativeResultItem)
        {
            NativeTypes.FABRIC_SERVICE_GROUP_TYPE_MEMBER_DESCRIPTION_LIST *nativeMemberList =
                (NativeTypes.FABRIC_SERVICE_GROUP_TYPE_MEMBER_DESCRIPTION_LIST *)nativeResultItem.ServiceGroupMemberTypeDescription;

            ICollection <ServiceGroupTypeMemberDescription> serviceGroupMemberTypeDescription = new Collection <ServiceGroupTypeMemberDescription>();

            for (int i = 0; i < nativeMemberList->Count; i++)
            {
                serviceGroupMemberTypeDescription.Add(
                    ServiceGroupTypeMemberDescription.CreateFromNative(nativeMemberList->Items + (i * Marshal.SizeOf(typeof(NativeTypes.FABRIC_SERVICE_GROUP_TYPE_MEMBER_DESCRIPTION))), true));
            }

            return(new ServiceGroupMemberType(
                       serviceGroupMemberTypeDescription,
                       NativeTypes.FromNativeString(nativeResultItem.ServiceManifestVersion),
                       NativeTypes.FromNativeString(nativeResultItem.ServiceManifestName)));
        }
Exemplo n.º 2
0
        public void Init()
        {
            // Application Type
            FABRIC_APPLICATION_TYPE_QUERY_RESULT_ITEM_      = this.random.CreateRandom <ApplicationType>();
            FABRIC_APPLICATION_TYPE_QUERY_RESULT_ITEM_LIST_ = new ApplicationTypeList()
            {
                this.random.CreateRandom <ApplicationType>()
            };

            FABRIC_APPLICATION_TYPE_QUERY_RESULT_ITEM_PAGED_LIST_ = new ApplicationTypePagedList();
            FABRIC_APPLICATION_TYPE_QUERY_RESULT_ITEM_PAGED_LIST_.ContinuationToken = "ContinuationToken342741";
            FABRIC_APPLICATION_TYPE_QUERY_RESULT_ITEM_PAGED_LIST_.Add(this.random.CreateRandom <ApplicationType>());
            FABRIC_APPLICATION_TYPE_QUERY_RESULT_ITEM_PAGED_LIST_.Add(this.random.CreateRandom <ApplicationType>());
            FABRIC_APPLICATION_TYPE_QUERY_RESULT_ITEM_PAGED_LIST_.Add(this.random.CreateRandom <ApplicationType>());

            // Application
            FABRIC_APPLICATION_QUERY_RESULT_ITEM_      = this.random.CreateRandom <Application>();
            FABRIC_APPLICATION_QUERY_RESULT_ITEM_LIST_ = new ApplicationList()
            {
                this.random.CreateRandom <Application>(), this.random.CreateRandom <Application>()
            };

            // Service Type
            FABRIC_SERVICE_TYPE_DESCRIPTION_       = this.random.CreateRandom <ServiceTypeDescription>();
            FABRIC_SERVICE_TYPE_QUERY_RESULT_ITEM_ = this.random.CreateRandom <ServiceType>();
            FABRIC_SERVICE_TYPE_QUERY_RESULT_LIST_ = new ServiceTypeList()
            {
                this.random.CreateRandom <ServiceType>()
            };

            //Replica
            FABRIC_SERVICE_REPLICA_QUERY_RESULT_ITEM_ = this.CreateReplica();

            FABRIC_SERVICE_REPLICA_LIST_RESULT_ = new ServiceReplicaList();
            FABRIC_SERVICE_REPLICA_LIST_RESULT_.ContinuationToken = "4387284";
            FABRIC_SERVICE_REPLICA_LIST_RESULT_.Add(this.CreateReplica());
            FABRIC_SERVICE_REPLICA_LIST_RESULT_.Add(this.CreateReplica());

            // Partition
            FABRIC_SERVICE_PARTITION_INFORMATION_       = this.random.CreateRandom <ServicePartitionInformation>();
            FABRIC_SERVICE_PARTITION_QUERY_RESULT_ITEM_ = CreatePartition();

            FABRIC_SERVICE_PARTITION_LIST_RESULT_ = new ServicePartitionList();
            FABRIC_SERVICE_PARTITION_LIST_RESULT_.ContinuationToken = Guid.NewGuid().ToString();
            FABRIC_SERVICE_PARTITION_LIST_RESULT_.Add(this.CreatePartition());
            FABRIC_SERVICE_PARTITION_LIST_RESULT_.Add(this.CreatePartition());

            //Service
            FABRIC_SERVICE_QUERY_RESULT_ITEM_ = this.CreateServiceQueryItem();
            FABRIC_SERVICE_QUERY_RESULT_LIST_ = new ServiceList()
            {
                this.CreateServiceQueryItem(), this.CreateServiceQueryItem()
            };

            // Node
            FABRIC_NODE_DEACTIVATION_QUERY_RESULT_ITEM_ = this.random.CreateRandom <NodeDeactivationResult>();
            FABRIC_NODE_DEACTIVATION_TASK_ = this.random.CreateRandom <NodeDeactivationTask>();
            FABRIC_NODE_QUERY_RESULT_ITEM_ = this.random.CreateRandom <Node>();

            // NodeList with continuation token
            FABRIC_NODE_LIST_QUERY_RESULT_ = new NodeList();
            FABRIC_NODE_LIST_QUERY_RESULT_.ContinuationToken = "ContinuationToken34274";
            FABRIC_NODE_LIST_QUERY_RESULT_.Add(this.random.CreateRandom <Node>());
            FABRIC_NODE_LIST_QUERY_RESULT_.Add(this.random.CreateRandom <Node>());
            FABRIC_NODE_LIST_QUERY_RESULT_.Add(this.random.CreateRandom <Node>());

            // Deployed Application
            FABRIC_DEPLOYED_APPLICATION_QUERY_RESULT_ITEM_      = this.random.CreateRandom <DeployedApplication>();
            FABRIC_DEPLOYED_APPLICATION_QUERY_RESULT_ITEM_LIST_ = new DeployedApplicationList()
            {
                FABRIC_DEPLOYED_APPLICATION_QUERY_RESULT_ITEM_
            };

            FABRIC_DEPLOYED_APPLICATION_QUERY_RESULT_ITEM_PAGED_LIST_ = new DeployedApplicationPagedList();
            FABRIC_DEPLOYED_APPLICATION_QUERY_RESULT_ITEM_PAGED_LIST_.ContinuationToken = "ContinuationToken342741";
            FABRIC_DEPLOYED_APPLICATION_QUERY_RESULT_ITEM_PAGED_LIST_.Add(this.random.CreateRandom <DeployedApplication>());
            FABRIC_DEPLOYED_APPLICATION_QUERY_RESULT_ITEM_PAGED_LIST_.Add(this.random.CreateRandom <DeployedApplication>());
            FABRIC_DEPLOYED_APPLICATION_QUERY_RESULT_ITEM_PAGED_LIST_.Add(this.random.CreateRandom <DeployedApplication>());

            // Deployed Service
            FABRIC_DEPLOYED_SERVICE_REPLICA_QUERY_RESULT_ITEM_         = this.random.CreateRandom <DeployedStatefulServiceReplica>();
            FABRIC_DEPLOYED_SERVICE_REPLICA_QUERY_RESULT_ITEM2_        = this.random.CreateRandom <DeployedStatelessServiceInstance>();
            FABRIC_DEPLOYED_SERVICE_REPLICA_QUERY_RESULT_ITEM3_        = this.random.CreateRandom <DeployedServiceReplica>();
            FABRIC_DEPLOYED_SERVICE_REPLICA_DETAIL_QUERY_RESULT_ITEM_  = this.random.CreateRandom <DeployedStatefulServiceReplicaDetail>();
            FABRIC_DEPLOYED_SERVICE_REPLICA_DETAIL_QUERY_RESULT_ITEM2_ = this.random.CreateRandom <DeployedStatelessServiceInstanceDetail>();

            // Code Package
            FABRIC_CODE_PACKAGE_ENTRY_POINT_STATISTICS_          = this.random.CreateRandom <CodePackageEntryPointStatistics>();
            FABRIC_CODE_PACKAGE_ENTRY_POINT_                     = this.random.CreateRandom <CodePackageEntryPoint>();
            FABRIC_DEPLOYED_CODE_PACKAGE_QUERY_RESULT_ITEM_      = this.random.CreateRandom <DeployedCodePackage>();
            FABRIC_DEPLOYED_CODE_PACKAGE_QUERY_RESULT_ITEM_LIST_ = new DeployedCodePackageList()
            {
                FABRIC_DEPLOYED_CODE_PACKAGE_QUERY_RESULT_ITEM_
            };
            FABRIC_DEPLOYED_SERVICE_PACKAGE_QUERY_RESULT_ITEM_ = this.random.CreateRandom <DeployedServicePackage>();

            // Replicator
            FABRIC_PRIMARY_REPLICATOR_STATUS_QUERY_RESULT_   = this.random.CreateRandom <PrimaryReplicatorStatus>();
            FABRIC_SECONDARY_REPLICATOR_STATUS_QUERY_RESULT_ = this.random.CreateRandom <SecondaryReplicatorStatus>();

            // Load
            FABRIC_LOAD_METRIC_INFORMATION_      = this.random.CreateRandom <LoadMetricInformation>();
            FABRIC_LOAD_METRIC_REPORT_           = this.random.CreateRandom <LoadMetricReport>();
            FABRIC_NODE_LOAD_METRIC_INFORMATION_ = this.random.CreateRandom <NodeLoadMetricInformation>();
            FABRIC_NODE_LOAD_INFORMATION_        = this.random.CreateRandom <NodeLoadInformation>();
            FABRIC_PARTITION_LOAD_INFORMATION_   = this.random.CreateRandom <PartitionLoadInformation>();
            FABRIC_REPLICA_LOAD_INFORMATION_     = this.random.CreateRandom <ReplicaLoadInformation>();

            // Service Group
            FABRIC_SERVICE_GROUP_TYPE_MEMBER_DESCRIPTION_       = this.random.CreateRandom <ServiceGroupTypeMemberDescription>();
            FABRIC_SERVICE_GROUP_MEMBER_TYPE_QUERY_RESULT_ITEM_ = this.random.CreateRandom <ServiceGroupMemberType>();
        }