关注 spark技术分享,
撸spark源码 玩spark最佳实践

LongHashedRelation

LongHashedRelation

LongHashedRelation is a HashedRelation that is used when HashedRelation is requested for a concrete HashedRelation instance when the single key is of type long.

LongHashedRelation is also a Java Externalizable, i.e. when persisted, only the identity is written in the serialization stream and it is the responsibility of the class to save and restore the contents of its instances.

LongHashedRelation is created when:

  1. HashedRelation is requested for a concrete HashedRelation (and apply factory method is used)

  2. LongHashedRelation is requested for a read-only copy (when BroadcastHashJoinExec is requested to execute)

writeExternal Method

Note
writeExternal is part of Java’s Externalizable Contract to…​FIXME.

writeExternal…​FIXME

Note
writeExternal is used when…​FIXME

readExternal Method

Note
readExternal is part of Java’s Externalizable Contract to…​FIXME.

readExternal…​FIXME

Note
readExternal is used when…​FIXME

Creating LongHashedRelation Instance

LongHashedRelation takes the following when created:

  • Number of fields

  • LongToUnsafeRowMap

LongHashedRelation initializes the internal registries and counters.

Creating Read-Only Copy of LongHashedRelation — asReadOnlyCopy Method

Note
asReadOnlyCopy is part of HashedRelation Contract to…​FIXME.

asReadOnlyCopy…​FIXME

Getting Value Row for Given Key — getValue Method

Note
getValue is part of HashedRelation Contract to give the value internal row for a given key.

getValue checks if the input key is null at 0 position and if so gives null. Otherwise, getValue takes the long value at position 0 and gets the value.

Creating LongHashedRelation Instance — apply Factory Method

apply…​FIXME

Note
apply is used exclusively when HashedRelation is requested for a concrete HashedRelation.
赞(0) 打赏
未经允许不得转载:spark技术分享 » LongHashedRelation
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏