Exemplo n.º 1
0
        void LoadData()
        {
            if (BayWind == null)
            {
                BayWind = new BayWind();
            }

            //** Create a Dictionary Factory
            Sop.StoreFactory StoreFactory = new Sop.StoreFactory();

            //** retrieve the Object Stores from BayWind DB...
            PeopleStore =
                StoreFactory.Get <BayWind.PersonKey, BayWind.Person>(BayWind.Server.SystemFile.Store, "People", new BayWind.PersonComparer());
            AddressStore =
                StoreFactory.Get <int, BayWind.Address>(BayWind.Server.SystemFile.Store, "Address");
            PeopleStore.MoveFirst();
            DisplayPage();
        }
Exemplo n.º 2
0
 private void buttonInitDB_Click(object sender, EventArgs e)
 {
     dataGridViewPeople.DataSource = null;
     dataGridViewPeople.Refresh();
     if (BayWind != null)
     {
         BayWind.Dispose();
     }
     if (System.IO.File.Exists(Sop.Samples.BayWind.ServerFilename))
     {
         //** delete entire directory to ensure all files including transaction
         //** temp/logs and settings are removed as well...
         System.IO.Directory.Delete(Sop.Samples.BayWind.ServerPath, true);
         System.IO.Directory.CreateDirectory(Sop.Samples.BayWind.ServerPath);
     }
     BayWind = new BayWind();
     BayWind.Run();
     BayWind.Server.BeginTransaction();
     LoadData();
 }
Exemplo n.º 3
0
        public static void Main()
        {
            var demo = DemoType.OneHundredMillionInserts;
            //.PeopleDirectoryLargeDB;
            //.Store400;
            //.VirtualCacheMemoryExtenderMultipleClients;    //VirtualCacheMemoryExtenderReCreate;
            dynamic pd = null;

            switch (demo)
            {
            case DemoType.VirtualCacheMemoryExtenderMultipleClients:
                pd = new VirtualCacheMemoryExtenderMultipleClients();
                break;

            case DemoType.VirtualCacheThreaded:
                pd = new VirtualCacheThreaded();
                break;

            //case DemoType.VirtualCacheWithBackgroundRefreshDemo:
            //    pd = new VirtualCacheWithBackgroundRefreshDemo();
            //    break;
            case DemoType.VirtualCacheMemoryExtenderReCreate:
                pd = new VirtualCacheMemoryExtenderReCreate();
                break;

            case DemoType.PeopleDirectoryWithUpdateDelete:
                pd = new PeopleDirectoryWithUpdateDelete();
                break;

            case DemoType.VirtualCacheDemo:
                pd = new VirtualCacheDemo();
                break;

            case DemoType.VirtualCacheMemoryCacheCompare:
                pd = new VirtualCacheMemoryCacheCompare();
                break;

            case DemoType.RenameItemKeysOfStore:
                pd = new RenameItemsOfStore();
                break;

            case DemoType.ObjectDirectory:
                pd = new ObjectDirectory();
                break;

            case DemoType.ObjectDirectoryLINQ:
                pd = new ObjectDirectoryLINQ();
                break;

            case DemoType.PeopleDirectoryWithBigData:
                pd = new PeopleDirectoryWithBigData();
                break;

            //NOTE: Store rename is not supported in 4.7.
            //case DemoType.RenameStore:
            //    pd = new RenameStore();
            //    break;
            case DemoType.PeopleDirectoryXmlSerializableObject:
                pd = new PeopleDirectoryXmlSerializableObject();
                break;

            case DemoType.PeopleDirectoryWithBlobDataQueryFunc:
                pd = new PeopleDirectoryWithBlobDataQueryFunc();
                break;

            case DemoType.PeopleDirectoryWithBlobDataAddUniqueCheck:
                pd = new PeopleDirectoryWithBlobDataAddUniqueCheck();
                break;

            case DemoType.PeopleDirectoryWithBlobDataNull:
                pd = new PeopleDirectoryWithBlobDataNull();
                break;

            case DemoType.PeopleDirectoryWithUpdateLargeDBLitePersistence:
                pd = new PeopleDirectoryWithUpdateLargeDBLitePersistence();
                break;

            case DemoType.NestedSortedDictionary:
                pd = new NestedSortedDictionary();
                break;

            case DemoType.PeopleDirectoryWithMediumDB:
                pd = new PeopleDirectoryWithMediumDB();
                break;

            case DemoType.BayWind:
                pd = new BayWind();
                break;

            case DemoType.Store400:
                pd = new Store400();
                break;

            case DemoType.MemoryExtender:
                pd = new MemoryExtender();
                break;

            case DemoType.MemoryExtenderGenerics:
                pd = new MemoryExtenderGenerics();
                break;

            case DemoType.IterateDescendingOrder:
                pd = new IterateDescendingOrder();
                break;

            case DemoType.ManageMultipleFiles:
                pd = new ManageMultipleFiles();
                break;

            case DemoType.PeopleDirectoryAsIPersistent:
                pd = new PeopleDirectoryAsIPersistent();
                break;

            case DemoType.PeopleDirectory:
                pd = new PeopleDirectory();
                break;

            case DemoType.PeopleDirectoryWithUpdate:
                pd = new PeopleDirectoryWithUpdate();
                break;

            case DemoType.PeopleDirectoryWithBlobData:
                pd = new PeopleDirectoryWithBlobData();
                break;

            case DemoType.PeopleDirectoryWithBlobDataUpdate:
                pd = new PeopleDirectoryWithBlobDataUpdate();
                break;

            case DemoType.PeopleDirectoryWithBlobDataDelete:
                pd = new PeopleDirectoryWithBlobDataDelete();
                break;

            case DemoType.PeopleDirectoryLargeDB:
                pd = new PeopleDirectoryLargeDB();
                break;

            case DemoType.ManyClientSimulator:
                pd = new ManyClientSimulator();
                pd.DeleteDataFolder(ManyClientSimulator.ServerFilename);
                // simulate numerous parallel clients accessing the same Store.
                // this demonstrates multi-reader, single writer SOP Store feature.
                pd.ThreadCount = 500;
                pd.DataInsertionThreadCount = 150;
                //pd.ThreadCount = 5;
                //pd.DataInsertionThreadCount = 2;
                pd.Threaded = true;
                break;

            case DemoType.OneHundredMillionInserts:
                pd = new OneHundredMillionInserts();
                pd.DeleteDataFolder(OneHundredMillionInserts.ServerFilename);
                pd.Insert = true;
                pd.Run();
                pd.Insert = false;
                break;
            }
            pd.Run();

            Console.WriteLine("Press any key to exit the App.");
            Console.ReadLine();
        }