Esempio n. 1
0
        private void AddRowToRowSet(long rowid)
        {
            // Get the index object
            IDataFile   df   = GetDataFile(rowIndexKey);
            SortedIndex rows = new SortedIndex(df);

            // Add the row in rowid value sorted order
            rows.InsertSortKey(rowid);
        }
Esempio n. 2
0
        internal void PrepareForCommit()
        {
            // Write the transaction log for this table,
            IDataFile df = GetDataFile(AddLog);

            df.Delete();
            SortedIndex addlist = new SortedIndex(df);

            foreach (long v in addRowList)
            {
                addlist.InsertSortKey(v);
            }

            df = GetDataFile(RemoveLog);
            df.Delete();
            SortedIndex deletelist = new SortedIndex(df);

            foreach (long v in deleteRowList)
            {
                if (addlist.ContainsSortKey(v))
                {
                    addlist.RemoveSortKey(v);
                }
                else
                {
                    deletelist.InsertSortKey(v);
                }
            }

            // Set the id gen key
            if (currentIdGen != -1)
            {
                StringDictionary p = TableProperties;
                p.SetValue("k", currentIdGen);
            }
        }