示例#1
0
        public MainPage()
        {
            AzureBlobsLogsInterface.SetToAzureBlobsLogs();
            this.InitializeComponent();

            LoadApplication(new ICGUI.App());
        }
示例#2
0
 public MockDataStore()
 {
     AzureBlobsLogsInterface.SetToAzureBlobsLogs();
     new Thread(new ThreadStart(() => _container = AmbrosiaFactory.Deploy <IXamarinSampleComm>("MockDataStore", new AmbrosiaMockDataStore(), 2500))).Start();
     while (AmbrosiaMockDataStore.myDataStore == null)
     {
         ;
     }
 }
示例#3
0
        public static void main(string[] args)
        {
            ParseAndValidateOptions(args);

            switch (_logStorageType)
            {
            case LogStorageOptions.Files:
                GenericLogsInterface.SetToGenericLogs();
                break;

            case LogStorageOptions.Blobs:
                AzureBlobsLogsInterface.SetToAzureBlobsLogs();
                break;
            }

            var replicaName = $"{_instanceName}{_replicaNumber}";

            if (_ipAddress == null)
            {
                _ipAddress = GetLocalIPAddress();
            }

            string storageConnectionString = null;

            if (storageConnectionString == null)
            {
                storageConnectionString = Environment.GetEnvironmentVariable("AZURE_STORAGE_CONN_STRING");
            }

            if (!_isActiveActive && _replicaNumber != 0)
            {
                throw new InvalidOperationException("Can't specify a replica number without the activeActive flag");
            }

            if (storageConnectionString == null)
            {
                throw new InvalidOperationException("Azure storage connection string not found. Use appSettings in your app.config to provide this using the key AZURE_STORAGE_CONN_STRING, or use the environment variable AZURE_STORAGE_CONN_STRING.");
            }

            int    connectionsPoolPerWorker;
            string connectionsPoolPerWorkerString = "0";

            if (connectionsPoolPerWorkerString != null)
            {
                try
                {
                    connectionsPoolPerWorker = Convert.ToInt32(connectionsPoolPerWorkerString);
                }
                catch
                {
                    throw new InvalidOperationException("Maximum number of connections per CRA worker is wrong. Use appSettings in your app.config to provide this using the key CRA_WORKER_MAX_CONN_POOL.");
                }
            }
            else
            {
                connectionsPoolPerWorker = 1000;
            }

            ISecureStreamConnectionDescriptor descriptor = null;

            if (_secureNetworkClassName != null)
            {
                Type type;
                if (_secureNetworkAssemblyName != null)
                {
                    var assembly = Assembly.Load(_secureNetworkAssemblyName);
                    type = assembly.GetType(_secureNetworkClassName);
                }
                else
                {
                    type = Type.GetType(_secureNetworkClassName);
                }
                descriptor = (ISecureStreamConnectionDescriptor)Activator.CreateInstance(type);
            }

            var dataProvider = new CRA.DataProvider.Azure.AzureDataProvider(storageConnectionString);
            var worker       = new CRAWorker
                                   (replicaName, _ipAddress, _port,
                                   dataProvider, descriptor, connectionsPoolPerWorker);

            worker.DisableDynamicLoading();
            worker.SideloadVertex(new AmbrosiaRuntime(), "ambrosia");

            worker.Start();
        }