示例#1
0
        public async Task CreateIndex(CreateIndexParameters indexParm)
        {
            if (string.IsNullOrEmpty(indexParm.Taxonomy))
            {
                Exception error = new Exception($"Taxonomy not selected");
                throw error;
            }
            Sources           sr     = new Sources(azureConnectionString);
            ConnectParameters target = await sr.GetSourceParameters(indexParm.TargetName);

            ConnectParameters source = await sr.GetSourceParameters(indexParm.SourceName);

            Indexer index       = new Indexer(azureConnectionString);
            int     parentNodes = await index.Initialize(target, source, indexParm.Taxonomy, indexParm.Filter);

            List <ParentIndexNodes> nodes = await index.IndexParent(parentNodes, indexParm.Filter);

            for (int j = 0; j < nodes.Count; j++)
            {
                ParentIndexNodes node = nodes[j];
                for (int i = 0; i < node.NodeCount; i++)
                {
                    await index.IndexChildren(j, i, node.ParentNodeId);
                }
            }
            index.CloseIndex();
        }
示例#2
0
        public static async Task <ConnectParameters> GetConnectParameters(string azureConnectionString, string connecterSource)
        {
            if (String.IsNullOrEmpty(azureConnectionString))
            {
                Exception error = new Exception($"Azure Connection string is not set");
                throw error;
            }
            Sources           so        = new Sources(azureConnectionString);
            ConnectParameters connector = await so.GetSourceParameters(connecterSource);

            return(connector);
        }
示例#3
0
        private async Task <ConnectParameters> GetConnector(string connectorStr)
        {
            if (String.IsNullOrEmpty(connectorStr))
            {
                Exception error = new Exception($"DataQc: Connection string is not set");
                throw error;
            }
            Sources           so        = new Sources(_azureConnectionString);
            ConnectParameters connector = await so.GetSourceParameters(connectorStr);

            return(connector);
        }
示例#4
0
        private async Task <string> GetConsistencySource(string RuleParameters)
        {
            string error = "";

            RuleMethodUtilities.ConsistencyParameters parms = new RuleMethodUtilities.ConsistencyParameters();
            if (!string.IsNullOrEmpty(RuleParameters))
            {
                try
                {
                    parms = JsonConvert.DeserializeObject <RuleMethodUtilities.ConsistencyParameters>(RuleParameters);
                }
                catch (Exception ex)
                {
                    error = $"Bad parameter Json, {ex}";
                }
            }
            Sources           so        = new Sources(_azureConnectionString);
            ConnectParameters connector = await so.GetSourceParameters(parms.Source);

            string source = connector.ConnectionString;

            return(source);
        }