internal void DeleteFully() { // Get the range of keys stored for this table, and delete it. IDataRange dataRange = transaction.Transaction.GetRange(new Key(1, tableId, 0), new Key(1, tableId, Int64.MaxValue)); dataRange.Delete(); }
public void ReplicateTo(IDataRange target) { if (target is DataRange) { // If the tree systems are different we fall back DataRange tTarget = (DataRange)target; if (TreeSystem == tTarget.TreeSystem) { // Fail condition (same transaction), if (tTarget.Transaction == Transaction) { throw new ArgumentException("'ReplicateTo' on the same transaction"); } // Ok, different transaction, same tree system source, both // TranDataRange objects, so we can do an efficient tree copy. // TODO: } } // The fallback method, // This uses the standard API to replicate all the keys in the target // range. // Note that if the target can't contain the keys because they fall // outside of its bound then the exception comes from the target. target.Delete(); long sz = Count; long pos = 0; while (pos < sz) { MoveTo(pos); Key key = CurrentKey; IDataFile df = GetCurrentFile(FileAccess.Read); IDataFile targetDf = target.GetFile(key, FileAccess.Write); df.ReplicateTo(targetDf); pos = MoveToNextKey(); } }