What is the best way for URL clustering in Map-reduce job java : I have a huge data set of URLs from various domains. I have to process them via mapreduce so that the URLs with similar pattern are grouped together. For example


    http://www.agricorner.com/price/onion-prices/
    http://www.agricorner.com/price/potato-prices/
    http://www.agricorner.com/price/ladyfinder-prices/
    
    http://www.agricorner.com/tag/story/story-1.html
    http://www.agricorner.com/tag/story/story-11.html
    http://www.agricorner.com/tag/story/story-41.html
    
    https://agrihunt.com/author/ramzan/page/3/
    https://agrihunt.com/author/shahban/page/5/
    https://agrihunt.com/author/Sufer/page/3/



I want to group these URLs based on their pattern i.e., if URLs has similar pattern ( in reducer phase of Map-reduce). The expected output may be like 


    group1, http://www.agricorner.com/price/onion-prices/, http://www.agricorner.com/price/potato-prices/, http://www.agricorner.com/price/ladyfinder-prices/
    
    group2, http://www.agricorner.com/tag/story/story-1.html, http://www.agricorner.com/tag/story/story-11.html, http://www.agricorner.com/tag/story/story-41.html
    
    group3, https://agrihunt.com/author/ramzan/page/3/, https://agrihunt.com/author/shahban/page/5/, https://agrihunt.com/author/Sufer/page/3/

It it possible ? Is there any better approach that the supposed one?