Share via


HpcLinqQueryable.AssumeHashPartition Method (IQueryable, Expression, IEqualityComparer)

Indicates to LINQ to HPC that the specified set of records was divided into DSC files by calculating a hash value for a key for the record, and by assigning records to DSC files according to that hash value. Records with the same hash value were assigned to the same DSC file.

Namespace: Microsoft.Hpc.Linq
Assembly: Microsoft.Hpc.Linq (in Microsoft.Hpc.Linq.dll)

Usage

'Usage
Dim source As IQueryable(Of TSource)
Dim keySelector As Expression(Of Func(Of TSource, TKey))
Dim comparer As IEqualityComparer(Of TKey)
Dim returnValue As IQueryable(Of TSource)

returnValue = HpcLinqQueryable.AssumeHashPartition(source, keySelector, comparer)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function AssumeHashPartition(Of TSource, TKey) ( _
    source As IQueryable(Of TSource), _
    keySelector As Expression(Of Func(Of TSource, TKey)), _
    comparer As IEqualityComparer(Of TKey) _
) As IQueryable(Of TSource)
[ExtensionAttribute] 
public static IQueryable<TSource> AssumeHashPartition<TSource,TKey> (
    IQueryable<TSource> source,
    Expression<Func<TSource,TKey>> keySelector,
    IEqualityComparer<TKey> comparer
)
[ExtensionAttribute] 
public:
generic<typename TSource, typename TKey>
static IQueryable<TSource>^ AssumeHashPartition (
    IQueryable<TSource>^ source, 
    Expression<Func<TSource, TKey>^>^ keySelector, 
    IEqualityComparer<TKey>^ comparer
)
J# supports the use of generic APIs, but not the declaration of new ones.
JScript does not support generic types or methods.

GenericParameters

  • TSource
    The type of the records in the source parameter.
  • TKey
    The return type of the function that you specify in the keySelector parameter to generate the key from a record.

Parameters

  • source
    A System.Linq.IQueryable<TSource> interface for the set of records that you want to designate as partitioned into DSC files according to a hash value.
  • keySelector
    A System.Linq.Expressions.Expression(Func(TSource, TKey)) object that specifies a function that generates a key from each record. The hash partition operation divides the records into DSC files by using a hash value calculated from this key.
  • comparer
    An System.Collections.Generic.IEqualityComparer{<TKey> interface that specifies a comparison object that provides methods that determine if two objects of the type that the TKey parameter specifies are equal and generate hash codes to use instead of the hash codes produced by the default hash code generator.

Return Value

The same IQueryable interface that you specified in the source parameter.

Exceptions

Exception type Condition
ArgumentNullException

The specified source or keySelector parameter is a null reference (Nothing in Visual Basic).

Remarks

To indicate that the default comparer object was used to compare hash values when the records were divided into DSC files, use the AssumeHashPartition(Generic IQueryable,Generic Expression) form of the method.

In Visual Basic and C#, you can call this method as an instance method on any object of type IQueryable<TSource>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

This method has at least one parameter of type Expression with a type argument that is one of the Func types. For these parameters, you can pass in a lambda expression and it compiles to an Expression.

Platform Note: This method was introduced in Windows HPC Server 2008 R2 with Service Pack 2 (SP2) and is not supported in previous versions.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP, Windows Vista, Windows 7, Windows 8, Windows Server 2003, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012

Target Platforms

Windows XP, Windows Vista, Windows 7, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, with HPC Pack Client Utilities

See Also

Reference

HpcLinqQueryable Class
HpcLinqQueryable Members
Microsoft.Hpc.Linq Namespace
HashPartition(Generic IQueryable,Generic Expression,Generic IEqualityComparer)
HashPartition(Generic IQueryable,Generic Expression,Generic IEqualityComparer,Int32)

Build Date:

2013-04-22