Skip to content

Use PartitionIterator for getPartition calls #215

@patduin

Description

@patduin

Depending on the batch size given we're doing potentially large listPartition calls here:
https://github.com/HotelsDotCom/circus-train/blob/main/circus-train-core/src/main/java/com/hotels/bdp/circustrain/core/HiveEndpoint.java#L152
and
https://github.com/HotelsDotCom/circus-train/blob/main/circus-train-core/src/main/java/com/hotels/bdp/circustrain/core/HiveEndpoint.java#L154

We should use a partitionIterator: https://github.com/HotelsDotCom/hcommon-hive-metastore/blob/master/src/main/java/com/hotels/hcommon/hive/metastore/iterator/PartitionIterator.java if possible.

Benefit is that we'll be nicer to the Hive Metastore as calling getPartition with a very high number of will cause OOMs in the Metastore. Good rule of thumb is to try and not fetch more than 1000 partitions in one call.

Wether CT will fail trying to replicate 10000 partitions is another matter but at least we stop causing issues to the Metastore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions