org.apache.hadoop.hive.ql.exec
Class ArchiveUtils.HarPathHelper

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.ArchiveUtils.HarPathHelper
Enclosing class:
ArchiveUtils

public static class ArchiveUtils.HarPathHelper
extends Object

HarPathHelper helps to create har:/ URIs for locations inside of archive.


Constructor Summary
ArchiveUtils.HarPathHelper(HiveConf hconf, URI archive, URI originalBase)
          Creates helper for archive.
 
Method Summary
 URI getHarUri(URI original)
          Creates har URI for file/directory that was put there when creating HAR.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchiveUtils.HarPathHelper

public ArchiveUtils.HarPathHelper(HiveConf hconf,
                                  URI archive,
                                  URI originalBase)
                           throws HiveException
Creates helper for archive.

Parameters:
archive - absolute location of archive in underlying filesystem
originalBase - directory for which Hadoop archive was created
Throws:
HiveException
Method Detail

getHarUri

public URI getHarUri(URI original)
              throws HiveException
Creates har URI for file/directory that was put there when creating HAR. With older versions of Hadoop, archiving a directory would produce the same directory structure, reflecting absoulute paths. If you created myArchive.har of /tmp/myDir the files in /tmp/myDir will be located under myArchive.har/tmp/myDir/* With newer versions, the parent directory can be specified. Assuming the parent directory was set to /tmp/myDir when creating the archive, the files can be found under myArchive.har/* This is why originalBase is argument - with new versions we can relativize URI, in older we keep absolute one.

Parameters:
original - file/directory path
Returns:
absolute HAR uri
Throws:
HiveException


Copyright © 2013 The Apache Software Foundation