Apache Spark graphx



I am very new to spark and i want to know if we can perform sort using apache graphx’s pregel API.
Bcoz most pregel example i see are related to distance calculation or some aggregation .
can we do something which outputs a specific route of graph(like sort).