Class MongoInputPartition
- java.lang.Object
-
- com.mongodb.spark.sql.connector.read.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 instanceMongoInputPartition(int partitionId, java.util.List<org.bson.BsonDocument> pipeline, java.util.List<java.lang.String> preferredLocations)
Construct a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
getPartitionId()
java.util.List<org.bson.BsonDocument>
getPipeline()
java.util.List<java.lang.String>
getPreferredLocations()
int
hashCode()
java.lang.String[]
preferredLocations()
The preferred locations for the read.java.lang.String
toString()
-
-
-
Constructor Detail
-
MongoInputPartition
public MongoInputPartition(int partitionId, java.util.List<org.bson.BsonDocument> pipeline)
Construct a new instance- Parameters:
partitionId
- the id of the partitionpipeline
- 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 partitionpipeline
- the pipeline to partition the collectionpreferredLocations
- 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 interfaceInputPartition
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-