Class MongoInputPartition

  • All Implemented Interfaces:
    java.io.Serializable, InputPartition

    public class MongoInputPartition
    extends java.lang.Object
    implements InputPartition
    The MongoInputPartition.

    Provides the meta information regarding a partition of a collection

    See Also:
    Serialized Form
    • Constructor Detail

      • MongoInputPartition

        public MongoInputPartition​(int partitionId,
                                   java.util.List<org.bson.BsonDocument> pipeline)
        Construct a new instance
        Parameters:
        partitionId - the id of the partition
        pipeline - the pipeline to partition the collection
      • MongoInputPartition

        public MongoInputPartition​(int partitionId,
                                   java.util.List<org.bson.BsonDocument> pipeline,
                                   ResumeTokenPartitionOffset resumeTokenPartitionOffset)
        Construct a new instance
        Parameters:
        partitionId - the id of the partition
        pipeline - the pipeline to partition the collection
        resumeTokenPartitionOffset - the resume token offset for the partition
      • MongoInputPartition

        public MongoInputPartition​(int partitionId,
                                   java.util.List<org.bson.BsonDocument> pipeline,
                                   java.util.List<java.lang.String> preferredLocations)
        Construct a new instance
        Parameters:
        partitionId - the id of the partition
        pipeline - the pipeline to partition the collection
        preferredLocations - the preferred server locations
    • Method Detail

      • getPartitionId

        public int getPartitionId()
        Returns:
        the partition id
      • getResumeTokenPartitionOffset

        public ResumeTokenPartitionOffset getResumeTokenPartitionOffset()
        Returns:
        the resume token offset
      • getPipeline

        public java.util.List<org.bson.BsonDocument> getPipeline()
        Returns:
        the aggregation pipeline for the partition
      • preferredLocations

        public java.lang.String[] preferredLocations()
        The preferred locations for the read.

        This may be the hostname of an individual mongos shard host or just the locations of the MongoDB cluster.

        Specified by:
        preferredLocations in interface InputPartition
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object