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 Summary

      Constructors 
      Constructor Description
      MongoInputPartition​(int partitionId, java.util.List<org.bson.BsonDocument> pipeline)
      Construct a new instance
      MongoInputPartition​(int partitionId, java.util.List<org.bson.BsonDocument> pipeline, java.util.List<java.lang.String> preferredLocations)
      Construct a new instance
    • 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,
                                   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
      • getPipeline

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

        public java.util.List<java.lang.String> getPreferredLocations()
        Returns:
        the preferred locations as a list
      • 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