Partitioner.Create 方法

定义

创建分区程序。Creates a partitioner.

重载

Create(Int32, Int32)

创建一个按用户指定的范围划分区块的分区程序。Creates a partitioner that chunks the user-specified range.

Create(Int64, Int64)

创建一个按用户指定的范围划分区块的分区程序。Creates a partitioner that chunks the user-specified range.

Create(Int32, Int32, Int32)

创建一个按用户指定的范围划分区块的分区程序。Creates a partitioner that chunks the user-specified range.

Create(Int64, Int64, Int64)

创建一个按用户指定的范围划分区块的分区程序。Creates a partitioner that chunks the user-specified range.

Create<TSource>(IEnumerable<TSource>)

IEnumerable<T> 实例创建一个可排序分区程序。Creates an orderable partitioner from a IEnumerable<T> instance.

Create<TSource>(IEnumerable<TSource>, EnumerablePartitionerOptions)

IEnumerable<T> 实例创建一个可排序分区程序。Creates an orderable partitioner from a IEnumerable<T> instance.

Create<TSource>(IList<TSource>, Boolean)

IList<T> 实例创建一个可排序分区程序。Creates an orderable partitioner from an IList<T> instance.

Create<TSource>(TSource[], Boolean)

Array 实例创建一个可排序分区程序。Creates an orderable partitioner from a Array instance.

Create(Int32, Int32)

创建一个按用户指定的范围划分区块的分区程序。Creates a partitioner that chunks the user-specified range.

public:
 static System::Collections::Concurrent::OrderablePartitioner<Tuple<int, int> ^> ^ Create(int fromInclusive, int toExclusive);
public static System.Collections.Concurrent.OrderablePartitioner<Tuple<int,int>> Create (int fromInclusive, int toExclusive);
static member Create : int * int -> System.Collections.Concurrent.OrderablePartitioner<int * int>
Public Shared Function Create (fromInclusive As Integer, toExclusive As Integer) As OrderablePartitioner(Of Tuple(Of Integer, Integer))

参数

fromInclusive
Int32

范围下限(含)。The lower, inclusive bound of the range.

toExclusive
Int32

范围上限(不含)。The upper, exclusive bound of the range.

返回

一个分区程序。A partitioner.

异常

toExclusive 参数小于或等于 fromInclusive 参数。The toExclusive argument is less than or equal to the fromInclusive argument.

注解

有关详细信息和示例,请参阅用于 PLINQ 和 TPL 的自定义分区程序For more information and examples, see Custom Partitioners for PLINQ and TPL.

另请参阅

Create(Int64, Int64)

创建一个按用户指定的范围划分区块的分区程序。Creates a partitioner that chunks the user-specified range.

public:
 static System::Collections::Concurrent::OrderablePartitioner<Tuple<long, long> ^> ^ Create(long fromInclusive, long toExclusive);
public static System.Collections.Concurrent.OrderablePartitioner<Tuple<long,long>> Create (long fromInclusive, long toExclusive);
static member Create : int64 * int64 -> System.Collections.Concurrent.OrderablePartitioner<int64 * int64>
Public Shared Function Create (fromInclusive As Long, toExclusive As Long) As OrderablePartitioner(Of Tuple(Of Long, Long))

参数

fromInclusive
Int64

范围下限(含)。The lower, inclusive bound of the range.

toExclusive
Int64

范围上限(不含)。The upper, exclusive bound of the range.

返回

一个分区程序。A partitioner.

异常

toExclusive 参数小于或等于 fromInclusive 参数。The toExclusive argument is less than or equal to the fromInclusive argument.

注解

有关详细信息和示例,请参阅用于 PLINQ 和 TPL 的自定义分区程序For more information and examples, see Custom Partitioners for PLINQ and TPL.

另请参阅

Create(Int32, Int32, Int32)

创建一个按用户指定的范围划分区块的分区程序。Creates a partitioner that chunks the user-specified range.

public:
 static System::Collections::Concurrent::OrderablePartitioner<Tuple<int, int> ^> ^ Create(int fromInclusive, int toExclusive, int rangeSize);
public static System.Collections.Concurrent.OrderablePartitioner<Tuple<int,int>> Create (int fromInclusive, int toExclusive, int rangeSize);
static member Create : int * int * int -> System.Collections.Concurrent.OrderablePartitioner<int * int>
Public Shared Function Create (fromInclusive As Integer, toExclusive As Integer, rangeSize As Integer) As OrderablePartitioner(Of Tuple(Of Integer, Integer))

参数

fromInclusive
Int32

范围下限(含)。The lower, inclusive bound of the range.

toExclusive
Int32

范围上限(不含)。The upper, exclusive bound of the range.

rangeSize
Int32

每个子范围的大小。The size of each subrange.

返回

一个分区程序。A partitioner.

异常

toExclusive 参数小于或等于 fromInclusive 参数。The toExclusive argument is less than or equal to the fromInclusive argument.

- 或 --or- rangeSize 参数小于或等于 0。The rangeSize argument is less than or equal to 0.

注解

有关详细信息和示例,请参阅用于 PLINQ 和 TPL 的自定义分区程序For more information and examples, see Custom Partitioners for PLINQ and TPL.

另请参阅

Create(Int64, Int64, Int64)

创建一个按用户指定的范围划分区块的分区程序。Creates a partitioner that chunks the user-specified range.

public:
 static System::Collections::Concurrent::OrderablePartitioner<Tuple<long, long> ^> ^ Create(long fromInclusive, long toExclusive, long rangeSize);
public static System.Collections.Concurrent.OrderablePartitioner<Tuple<long,long>> Create (long fromInclusive, long toExclusive, long rangeSize);
static member Create : int64 * int64 * int64 -> System.Collections.Concurrent.OrderablePartitioner<int64 * int64>
Public Shared Function Create (fromInclusive As Long, toExclusive As Long, rangeSize As Long) As OrderablePartitioner(Of Tuple(Of Long, Long))

参数

fromInclusive
Int64

范围下限(含)。The lower, inclusive bound of the range.

toExclusive
Int64

范围上限(不含)。The upper, exclusive bound of the range.

rangeSize
Int64

每个子范围的大小。The size of each subrange.

返回

一个分区程序。A partitioner.

异常

toExclusive 参数小于或等于 fromInclusive 参数。The toExclusive argument is less than or equal to the fromInclusive argument.

- 或 --or- rangeSize 参数小于或等于 0。The rangeSize argument is less than or equal to 0.

注解

有关详细信息和示例,请参阅用于 PLINQ 和 TPL 的自定义分区程序For more information and examples, see Custom Partitioners for PLINQ and TPL.

另请参阅

Create<TSource>(IEnumerable<TSource>)

IEnumerable<T> 实例创建一个可排序分区程序。Creates an orderable partitioner from a IEnumerable<T> instance.

public:
generic <typename TSource>
 static System::Collections::Concurrent::OrderablePartitioner<TSource> ^ Create(System::Collections::Generic::IEnumerable<TSource> ^ source);
public static System.Collections.Concurrent.OrderablePartitioner<TSource> Create<TSource> (System.Collections.Generic.IEnumerable<TSource> source);
static member Create : seq<'Source> -> System.Collections.Concurrent.OrderablePartitioner<'Source>
Public Shared Function Create(Of TSource) (source As IEnumerable(Of TSource)) As OrderablePartitioner(Of TSource)

类型参数

TSource

源可枚举项中的元素的类型。Type of the elements in source enumerable.

参数

source
IEnumerable<TSource>

要进行分区的可枚举项。The enumerable to be partitioned.

返回

基于输入数组的可排序分区程序。An orderable partitioner based on the input array.

注解

在创建的分区程序中使用的排序由元素的自然顺序确定,这是从可枚举的源中检索的。The ordering used in the created partitioner is determined by the natural order of the elements as retrieved from the source enumerable. 有关详细信息和示例,请参阅用于 PLINQ 和 TPL 的自定义分区程序For more information and examples, see Custom Partitioners for PLINQ and TPL.

另请参阅

Create<TSource>(IEnumerable<TSource>, EnumerablePartitionerOptions)

IEnumerable<T> 实例创建一个可排序分区程序。Creates an orderable partitioner from a IEnumerable<T> instance.

public:
generic <typename TSource>
 static System::Collections::Concurrent::OrderablePartitioner<TSource> ^ Create(System::Collections::Generic::IEnumerable<TSource> ^ source, System::Collections::Concurrent::EnumerablePartitionerOptions partitionerOptions);
public static System.Collections.Concurrent.OrderablePartitioner<TSource> Create<TSource> (System.Collections.Generic.IEnumerable<TSource> source, System.Collections.Concurrent.EnumerablePartitionerOptions partitionerOptions);
static member Create : seq<'Source> * System.Collections.Concurrent.EnumerablePartitionerOptions -> System.Collections.Concurrent.OrderablePartitioner<'Source>
Public Shared Function Create(Of TSource) (source As IEnumerable(Of TSource), partitionerOptions As EnumerablePartitionerOptions) As OrderablePartitioner(Of TSource)

类型参数

TSource

源可枚举项中的元素的类型。Type of the elements in source enumerable.

参数

source
IEnumerable<TSource>

要进行分区的可枚举项。The enumerable to be partitioned.

partitionerOptions
EnumerablePartitionerOptions

控制分区缓冲行为的选项。Options to control the buffering behavior of the partitioner.

返回

基于输入数组的可排序分区程序。An orderable partitioner based on the input array.

异常

partitionerOptions 参数为 EnumerablePartitionerOptions 指定无效值。The partitionerOptions argument specifies an invalid value for EnumerablePartitionerOptions.

注解

在创建的分区程序中使用的排序由元素的自然顺序确定,这是从可枚举的源中检索的。The ordering used in the created partitioner is determined by the natural order of the elements as retrieved from the source enumerable.

Create<TSource>(IList<TSource>, Boolean)

IList<T> 实例创建一个可排序分区程序。Creates an orderable partitioner from an IList<T> instance.

public:
generic <typename TSource>
 static System::Collections::Concurrent::OrderablePartitioner<TSource> ^ Create(System::Collections::Generic::IList<TSource> ^ list, bool loadBalance);
public static System.Collections.Concurrent.OrderablePartitioner<TSource> Create<TSource> (System.Collections.Generic.IList<TSource> list, bool loadBalance);
static member Create : System.Collections.Generic.IList<'Source> * bool -> System.Collections.Concurrent.OrderablePartitioner<'Source>
Public Shared Function Create(Of TSource) (list As IList(Of TSource), loadBalance As Boolean) As OrderablePartitioner(Of TSource)

类型参数

TSource

源列表中的元素的类型。Type of the elements in source list.

参数

list
IList<TSource>

要进行分区的列表。The list to be partitioned.

loadBalance
Boolean

一个布尔值,该值指示创建的分区程序是否应在各分区之间保持动态负载平衡,而不是静态负载平衡。A Boolean value that indicates whether the created partitioner should dynamically load balance between partitions rather than statically partition.

返回

基于输入列表的可排序分区程序。An orderable partitioner based on the input list.

注解

有关详细信息和示例,请参阅用于 PLINQ 和 TPL 的自定义分区程序For more information and examples, see Custom Partitioners for PLINQ and TPL.

另请参阅

Create<TSource>(TSource[], Boolean)

Array 实例创建一个可排序分区程序。Creates an orderable partitioner from a Array instance.

public:
generic <typename TSource>
 static System::Collections::Concurrent::OrderablePartitioner<TSource> ^ Create(cli::array <TSource> ^ array, bool loadBalance);
public static System.Collections.Concurrent.OrderablePartitioner<TSource> Create<TSource> (TSource[] array, bool loadBalance);
static member Create : 'Source[] * bool -> System.Collections.Concurrent.OrderablePartitioner<'Source>
Public Shared Function Create(Of TSource) (array As TSource(), loadBalance As Boolean) As OrderablePartitioner(Of TSource)

类型参数

TSource

源数组中的元素的类型。Type of the elements in source array.

参数

array
TSource[]

要进行分区的数组。The array to be partitioned.

loadBalance
Boolean

一个布尔值,该值指示创建的分区程序是否应在各分区之间保持动态负载平衡,而不是静态负载平衡。A Boolean value that indicates whether the created partitioner should dynamically load balance between partitions rather than statically partition.

返回

基于输入数组的可排序分区程序。An orderable partitioner based on the input array.

注解

有关详细信息和示例,请参阅用于 PLINQ 和 TPL 的自定义分区程序For more information and examples, see Custom Partitioners for PLINQ and TPL.

另请参阅

适用于