csharptest / CSharpTest.Net.Collections

BPlusTree and other collections moved from http://code.google.com/p/csharptest-net
109 stars 48 forks source link

Enumeration out of sequence. #4

Closed cybermerlin closed 10 years ago

cybermerlin commented 10 years ago
   IEnumerable<KeyValuePair<UInt32, ComboNode>> Values( ComboNode[] nodes ) {
      foreach( ComboNode cn in nodes )
        yield return new KeyValuePair<UInt32, ComboNode>( cn.id, cn );
    }

IEnumerable<KeyValuePair<UInt32, ComboNode>> bulkPairs = Combinations.Values( nodes.ToArray() );

// >>>> Enumeration out of sequence.    in next block
int cnt= combos.data.BulkInsert( bulkPairs, new BulkInsertOptions{
                    ReplaceContents = true,
                    InputIsSorted = true,
                    CommitOnCompletion = true,
                    DuplicateHandling = DuplicateHandling.RaisesException,
                } ); 
csharptest commented 10 years ago

@cybermerlin, when using the BulkInsert API, the BulkInsertOptions defines the state of the input, as well as the action to take. The exception you are seeing is a result of bulkPairs being an unordered (or improperly ordered) set while you specified the InputIsSorted value as true. Make sure when using InputIsSorted that the input key/value pairs are sorted by key with the same key comparer as specified when the BPlusTree was initially created.

cybermerlin commented 9 years ago

i use with\out options (+/- sorter) n duplicatehandling.none