6 // Jérémie "Garuma" Laval <jeremie.laval@gmail.com>
8 // Copyright (c) 2010 Jérémie "Garuma" Laval
10 // Permission is hereby granted, free of charge, to any person obtaining a copy
11 // of this software and associated documentation files (the "Software"), to deal
12 // in the Software without restriction, including without limitation the rights
13 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 // copies of the Software, and to permit persons to whom the Software is
15 // furnished to do so, subject to the following conditions:
17 // The above copyright notice and this permission notice shall be included in
18 // all copies or substantial portions of the Software.
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29 using System.Threading;
33 internal class QueryOptions
35 public ParallelMergeOptions? Options;
36 public ParallelExecutionMode? Mode;
37 public CancellationToken Token;
38 /* This token is to be used by some operator (like Take) to tell that
39 * the execution of the query can be prematurly stopped
41 * It is set when passing QueryOptions to the different node's Get method
42 * and ParallelExecuter should check after the call to this method is this guy has been
43 * set. Operator may chain up multiple cancellation token that way.
44 * When checking for this token, the task body should simply return.
46 public CancellationToken ImplementerToken;
48 public bool? BehindOrderGuard;
49 public int PartitionCount;
50 public Tuple<bool, bool, bool> PartitionerSettings;
52 public QueryOptions (ParallelMergeOptions? options,
53 ParallelExecutionMode? mode,
54 CancellationToken token,
56 bool? behindOrderGuard,
58 CancellationToken implementerToken)
64 BehindOrderGuard = behindOrderGuard;
65 PartitionCount = partitionCount;
66 PartitionerSettings = null;
67 ImplementerToken = implementerToken;