org.apache.pig.backend.local.datastorage
Class LocalDir

java.lang.Object
  extended by org.apache.pig.backend.local.datastorage.LocalPath
      extended by org.apache.pig.backend.local.datastorage.LocalDir
All Implemented Interfaces:
Comparable<ElementDescriptor>, Iterable<ElementDescriptor>, ContainerDescriptor, ElementDescriptor

public class LocalDir
extends LocalPath
implements ContainerDescriptor


Field Summary
 
Fields inherited from class org.apache.pig.backend.local.datastorage.LocalPath
fs, path
 
Fields inherited from interface org.apache.pig.backend.datastorage.ElementDescriptor
BLOCK_REPLICATION_KEY, BLOCK_SIZE_KEY, LENGTH_KEY, MODIFICATION_TIME_KEY
 
Constructor Summary
LocalDir(LocalDataStorage fs, File path)
           
LocalDir(LocalDataStorage fs, File parent, File child)
           
LocalDir(LocalDataStorage fs, File parent, String child)
           
LocalDir(LocalDataStorage fs, String path)
           
LocalDir(LocalDataStorage fs, String parent, File child)
           
LocalDir(LocalDataStorage fs, String parent, String child)
           
 
Method Summary
 void copy(ContainerDescriptor dstName, Properties dstConfiguration, boolean removeSrc)
           
 void copy(ElementDescriptor dstName, Properties dstConfiguration, boolean removeSrc)
          Copy entity from an existing one, possibly residing in a different Data Storage.
 OutputStream create(Properties configuration)
          Opens a stream onto which an entity can be written to.
 Iterator<ElementDescriptor> iterator()
           
 InputStream open()
           
 InputStream open(Properties configuration)
          Open for read a given entity
 SeekableInputStream sopen()
           
 SeekableInputStream sopen(Properties configuration)
          Open an element in the Data Storage with support for random access (seek operations).
 
Methods inherited from class org.apache.pig.backend.local.datastorage.LocalPath
compareTo, copy, create, delete, exists, getConfiguration, getCurPath, getDataStorage, getPath, getStatistics, rename, systemElement, toString, updateConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.pig.backend.datastorage.ElementDescriptor
copy, create, delete, exists, getConfiguration, getDataStorage, getStatistics, rename, systemElement, updateConfiguration
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

LocalDir

public LocalDir(LocalDataStorage fs,
                String path)

LocalDir

public LocalDir(LocalDataStorage fs,
                File path)

LocalDir

public LocalDir(LocalDataStorage fs,
                String parent,
                String child)

LocalDir

public LocalDir(LocalDataStorage fs,
                File parent,
                File child)

LocalDir

public LocalDir(LocalDataStorage fs,
                File parent,
                String child)

LocalDir

public LocalDir(LocalDataStorage fs,
                String parent,
                File child)
Method Detail

create

public OutputStream create(Properties configuration)
                    throws IOException
Description copied from interface: ElementDescriptor
Opens a stream onto which an entity can be written to.

Specified by:
create in interface ElementDescriptor
Specified by:
create in class LocalPath
Parameters:
configuration - information at the object level
Returns:
stream where to write
Throws:
DataStorageException
IOException

copy

public void copy(ElementDescriptor dstName,
                 Properties dstConfiguration,
                 boolean removeSrc)
          throws IOException
Description copied from interface: ElementDescriptor
Copy entity from an existing one, possibly residing in a different Data Storage.

Specified by:
copy in interface ElementDescriptor
Specified by:
copy in class LocalPath
Parameters:
dstName - name of entity to create
dstConfiguration - configuration for the new entity
removeSrc - if src entity needs to be removed after copying it
Throws:
DataStorageException - for instance, configuration information for new entity is not compatible with configuration information at the Data Storage level, user does not have privileges to read from source entity or write to destination storage...
IOException

copy

public void copy(ContainerDescriptor dstName,
                 Properties dstConfiguration,
                 boolean removeSrc)
          throws IOException
Throws:
IOException

open

public InputStream open(Properties configuration)
                 throws IOException
Description copied from interface: ElementDescriptor
Open for read a given entity

Specified by:
open in interface ElementDescriptor
Returns:
entity to read from
Throws:
IOException

open

public InputStream open()
                 throws IOException
Specified by:
open in interface ElementDescriptor
Specified by:
open in class LocalPath
Throws:
IOException

sopen

public SeekableInputStream sopen(Properties configuration)
                          throws IOException
Description copied from interface: ElementDescriptor
Open an element in the Data Storage with support for random access (seek operations).

Specified by:
sopen in interface ElementDescriptor
Returns:
a seekable input stream
Throws:
DataStorageException
IOException

sopen

public SeekableInputStream sopen()
                          throws IOException
Specified by:
sopen in interface ElementDescriptor
Specified by:
sopen in class LocalPath
Throws:
IOException

iterator

public Iterator<ElementDescriptor> iterator()
Specified by:
iterator in interface Iterable<ElementDescriptor>


Copyright © ${year} The Apache Software Foundation