Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="vertexName"></param>
        /// <param name="instanceName"></param>
        /// <param name="clientLibrary"></param>
        public DetachedVertex(string vertexName, string instanceName, CRAClientLibrary clientLibrary)
        {
            _vertexName    = vertexName;
            _clientLibrary = clientLibrary;

            if (instanceName == "")
            {
                _instanceName        = RandomString(16);
                _isEphemeralInstance = true;
                _clientLibrary.RegisterInstance(_instanceName, "", 0);
            }

            _clientLibrary._vertexManager.RegisterVertex(_vertexName, _instanceName);

            EndpointData   = new EndpointData();
            ConnectionData = new ConnectionData();
        }
Example #2
0
        /// <summary>
        /// Define a new worker instance of Common Runtime for Applications (CRA)
        /// </summary>
        /// <param name="workerInstanceName">Name of the worker instance</param>
        /// <param name="address">IP address</param>
        /// <param name="port">Port</param>
        /// <param name="storageConnectionString">Storage account to store metadata</param>
        /// <param name="streamsPoolSize">Maximum number of stream connections will be cached in the CRA client</param>
        /// <param name="descriptor">Secure stream connection callbacks</param>
        public CRAWorker(string workerInstanceName, string address, int port, string storageConnectionString, ISecureStreamConnectionDescriptor descriptor = null, int streamsPoolSize = 0)
        {
            _craClient = new CRAClientLibrary(storageConnectionString, this);

            _workerinstanceName = workerInstanceName;
            _address            = address;
            _port            = port;
            _streamsPoolSize = streamsPoolSize;

            _storageConnectionString = storageConnectionString;
            _storageAccount          = CloudStorageAccount.Parse(_storageConnectionString);
            _blobClient          = _storageAccount.CreateCloudBlobClient();
            _tableClient         = _storageAccount.CreateCloudTableClient();
            _workerInstanceTable = CreateTableIfNotExists("cravertextable");
            _connectionTable     = CreateTableIfNotExists("craconnectiontable");

            if (descriptor != null)
            {
                _craClient.SecureStreamConnectionDescriptor = descriptor;
            }
        }
Example #3
0
        /// <summary>
        /// Define a new worker instance of Common Runtime for Applications (CRA)
        /// </summary>
        /// <param name="workerInstanceName">Name of the worker instance</param>
        /// <param name="address">IP address</param>
        /// <param name="port">Port</param>
        /// <param name="storageConnectionString">Storage account to store metadata</param>
        /// <param name="streamsPoolSize">Maximum number of stream connections will be cached in the CRA client</param>
        /// <param name="descriptor">Secure stream connection callbacks</param>
        public CRAWorker(
            string workerInstanceName,
            string address,
            int port,
            IDataProvider azureDataProvider,
            ISecureStreamConnectionDescriptor descriptor = null,
            int streamsPoolSize = 0)
        {
            Console.WriteLine("Starting CRA Worker instance [http://github.com/Microsoft/CRA]");
            Console.WriteLine("   Instance Name: " + workerInstanceName);
            Console.WriteLine("   IP address: " + address);
            Console.WriteLine("   Port: " + port);

            if (descriptor != null)
            {
                Console.WriteLine("   Secure network connections: Enabled using assembly " + descriptor.GetType().FullName);
            }
            else
            {
                Console.WriteLine("   Secure network connections: Disabled");
            }

            _craClient = new CRAClientLibrary(azureDataProvider, this);

            _workerinstanceName = workerInstanceName;
            _address            = address;
            _port            = port;
            _streamsPoolSize = streamsPoolSize;

            _vertexInfoProvider     = azureDataProvider.GetVertexInfoProvider();
            _connectionInfoProvider = azureDataProvider.GetVertexConnectionInfoProvider();

            if (descriptor != null)
            {
                _craClient.SecureStreamConnectionDescriptor = descriptor;
            }
        }
Example #4
0
        /// <summary>
        /// Define a new worker instance of Common Runtime for Applications (CRA)
        /// </summary>
        /// <param name="workerInstanceName">Name of the worker instance</param>
        /// <param name="address">IP address</param>
        /// <param name="port">Port</param>
        /// <param name="storageConnectionString">Storage account to store metadata</param>
        /// <param name="streamsPoolSize">Maximum number of stream connections will be cached in the CRA client</param>
        /// <param name="descriptor">Secure stream connection callbacks</param>
        public CRAWorker(string workerInstanceName, string address, int port, string storageConnectionString, ISecureStreamConnectionDescriptor descriptor = null, int streamsPoolSize = 0)
        {
            Console.WriteLine("Starting CRA Worker instance [http://github.com/Microsoft/CRA]");
            Console.WriteLine("   Instance Name: " + workerInstanceName);
            Console.WriteLine("   IP address: " + address);
            Console.WriteLine("   Port: " + port);
            Console.WriteLine("   Azure connection string: " + storageConnectionString);

            if (descriptor != null)
            {
                Console.WriteLine("   Secure network connections: Enabled using assembly " + descriptor.GetType().FullName);
            }
            else
            {
                Console.WriteLine("   Secure network connections: Disabled");
            }

            _craClient = new CRAClientLibrary(storageConnectionString, this);

            _workerinstanceName = workerInstanceName;
            _address            = address;
            _port            = port;
            _streamsPoolSize = streamsPoolSize;

            _storageConnectionString = storageConnectionString;
            _storageAccount          = CloudStorageAccount.Parse(_storageConnectionString);
            _blobClient          = _storageAccount.CreateCloudBlobClient();
            _tableClient         = _storageAccount.CreateCloudTableClient();
            _workerInstanceTable = CreateTableIfNotExists("cravertextable");
            _connectionTable     = CreateTableIfNotExists("craconnectiontable");

            if (descriptor != null)
            {
                _craClient.SecureStreamConnectionDescriptor = descriptor;
            }
        }