|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.pig.piggybank.storage.partition.PathPartitioner
public class PathPartitioner
Its convenient sometimes to partition logs by date values or other e.g.
country, city etc.
A daydate partitioned hdfs directory might look something like:
/logs/repo/mylog/
daydate=2010-01-01
daydate=2010-01-02
This class accepts a path like /logs/repo/mylog and return a map of the
partition keys
| Constructor Summary | |
|---|---|
PathPartitioner()
|
|
| Method Summary | |
|---|---|
Set<String> |
getPartitionKeys(String location,
org.apache.hadoop.conf.Configuration conf)
Searches for the key=value pairs in the path pointer by the location parameter. |
Map<String,String> |
getPathPartitionKeyValues(String location)
Note: this must be the path lowes in the Searches for the key=value pairs in the path pointer by the location parameter. |
String[] |
parsePathKeyValue(String path)
Will look for key=value pairs in the path for example: /user/hive/warehouse/mylogs/year=2010/month=07 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PathPartitioner()
| Method Detail |
|---|
public Map<String,String> getPathPartitionKeyValues(String location)
throws IOException
location - String root path in hdsf e.g. /user/hive/warehouse or
/logs/repoconf - Configuration
IOException
public Set<String> getPartitionKeys(String location,
org.apache.hadoop.conf.Configuration conf)
throws IOException
location - String root path in hdsf e.g. /user/hive/warehouse or
/logs/repoconf - Configuration
IOExceptionpublic String[] parsePathKeyValue(String path)
path -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||