Ejemplo n.º 1
0
        public void TestFile()
        {
            //		FilePath	"C:\\Temp\\Historian\\635287587300536177-Stage1-d559e63e-d938-46a9-8d57-268f7c8ba194.d2"	string
            //635329017197429979-Stage1-38887e11-4097-4937-b269-ce4037157691.d2
            //using (var file = SortedTreeFile.OpenFile(@"C:\Temp\Historian\635287587300536177-Stage1-d559e63e-d938-46a9-8d57-268f7c8ba194.d2", true))
            using (SortedTreeFile file = SortedTreeFile.OpenFile(@"C:\Archive\635329017197429979-Stage1-38887e11-4097-4937-b269-ce4037157691.d2", true))
                //using (var file = SortedTreeFile.OpenFile(@"C:\Temp\Historian\635255664136496199-Stage2-6e758046-b2af-40ff-ae4e-85cd0c0e4501.d2", true))
                using (SortedTreeTable <HistorianKey, HistorianValue> table = file.OpenTable <HistorianKey, HistorianValue>())
                    using (SortedTreeTableReadSnapshot <HistorianKey, HistorianValue> reader = table.BeginRead())
                    {
                        SortedTreeScannerBase <HistorianKey, HistorianValue> scanner = reader.GetTreeScanner();
                        scanner.SeekToStart();
                        scanner.TestSequential().Count();

                        HistorianKey   key   = new HistorianKey();
                        HistorianValue value = new HistorianValue();

                        int x = 0;
                        scanner.Peek(key, value);

                        while (scanner.Read(key, value) && x < 10000)
                        {
                            System.Console.WriteLine(key.PointID);
                            x++;

                            scanner.Peek(key, value);
                        }

                        scanner.Count();
                    }
        }
 public void UpdateCachedValue()
 {
     CacheIsValid = Scanner.Peek(CacheKey, CacheValue);
 }