Visual Basic (Declaration) | |
---|---|
Public Property DuplicateHandling As DuplicateHandling |
C# | |
---|---|
public DuplicateHandling DuplicateHandling {get; set;} |
BPlusTree/BPlusTree.Test/TestBulkInsert.cs
C# | Copy Code |
---|---|
Dictionary<int, string> test = new Dictionary<int, string>(); IEnumerable<KeyValuePair<int, string>>[] sets = new List<IEnumerable<KeyValuePair<int, string>>>(CreateSets(1, 1000, test)).ToArray(); using (BPlusTree<int, string> tree = new BPlusTree<int, string>(Options)) { tree.BulkInsert( new OrderedKeyValuePairs<int, string>(sets[0]), new BulkInsertOptions { DuplicateHandling = DuplicateHandling.LastValueWins, InputIsSorted = true } ); VerifyDictionary(test, tree); // Use bulk insert to overwrite the contents of tree test = new Dictionary<int, string>(); sets = new List<IEnumerable<KeyValuePair<int, string>>>(CreateSets(1, 100, test)).ToArray(); tree.BulkInsert( new OrderedKeyValuePairs<int, string>(sets[0]), new BulkInsertOptions { CommitOnCompletion = false, InputIsSorted = true, ReplaceContents = true, DuplicateHandling = DuplicateHandling.RaisesException, } ); VerifyDictionary(test, tree); } |
VB.NET | Copy Code |
---|---|
Dim test As New Dictionary(Of Integer, String)() Dim sets As IEnumerable(Of KeyValuePair(Of Integer, String))() = New List(Of IEnumerable(Of KeyValuePair(Of Integer, String)))(CreateSets(1, 1000, test)).ToArray() Using tree As New BPlusTree(Of Integer, String)(Options) tree.BulkInsert(New OrderedKeyValuePairs(Of Integer, String)(sets(0)), New BulkInsertOptions() With { _ Key .DuplicateHandling = DuplicateHandling.LastValueWins, _ Key .InputIsSorted = True _ }) VerifyDictionary(test, tree) ' Use bulk insert to overwrite the contents of tree test = New Dictionary(Of Integer, String)() sets = New List(Of IEnumerable(Of KeyValuePair(Of Integer, String)))(CreateSets(1, 100, test)).ToArray() tree.BulkInsert(New OrderedKeyValuePairs(Of Integer, String)(sets(0)), New BulkInsertOptions() With { _ Key .CommitOnCompletion = False, _ Key .InputIsSorted = True, _ Key .ReplaceContents = True, _ Key .DuplicateHandling = DuplicateHandling.RaisesException _ }) VerifyDictionary(test, tree) End Using |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
BulkInsertOptions ClassBulkInsertOptions Members
DuplicateHandling
Used By
Int32 BPlusTreeInt32 BPlusTree