org.apache.pig.backend.datastorage
Interface DataStorage

All Known Implementing Classes:
HDataStorage

public interface DataStorage

DataStorage provides an abstraction of a generic container. Special instances of it can be a file system.


Field Summary
static String DEFAULT_REPLICATION_FACTOR_KEY
           
static String RAW_CAPACITY_KEY
           
static String RAW_USED_KEY
           
static String USED_BYTES_KEY
           
 
Method Summary
 ElementDescriptor[] asCollection(String pattern)
           
 ContainerDescriptor asContainer(ContainerDescriptor container)
           
 ContainerDescriptor asContainer(ContainerDescriptor parent, ContainerDescriptor child)
           
 ContainerDescriptor asContainer(ContainerDescriptor parent, String child)
           
 ContainerDescriptor asContainer(String name)
          Created an entity handle for a container.
 ContainerDescriptor asContainer(String parent, String child)
           
 ElementDescriptor asElement(ContainerDescriptor parent, ElementDescriptor child)
           
 ElementDescriptor asElement(ContainerDescriptor parent, String child)
           
 ElementDescriptor asElement(ElementDescriptor element)
           
 ElementDescriptor asElement(String name)
          Creates an entity handle for an object (no containment relation) from a String
 ElementDescriptor asElement(String parent, String child)
           
 void close()
          Clean-up and releasing of resources.
 ContainerDescriptor getActiveContainer()
           
 Properties getConfiguration()
          Provides configuration information about the storage itself.
 Map<String,Object> getStatistics()
          Provides statistics on the Storage: capacity values, how much storage is in use...
 void init()
          Place holder for possible initialization activities.
 boolean isContainer(String name)
           
 void setActiveContainer(ContainerDescriptor container)
           
 void updateConfiguration(Properties newConfiguration)
          Provides a way to change configuration parameters at the Data Storage level.
 

Field Detail

DEFAULT_REPLICATION_FACTOR_KEY

static final String DEFAULT_REPLICATION_FACTOR_KEY
See Also:
Constant Field Values

USED_BYTES_KEY

static final String USED_BYTES_KEY
See Also:
Constant Field Values

RAW_CAPACITY_KEY

static final String RAW_CAPACITY_KEY
See Also:
Constant Field Values

RAW_USED_KEY

static final String RAW_USED_KEY
See Also:
Constant Field Values
Method Detail

init

void init()
Place holder for possible initialization activities.


close

void close()
           throws IOException
Clean-up and releasing of resources.

Throws:
IOException

getConfiguration

Properties getConfiguration()
Provides configuration information about the storage itself. For instance global data-replication policies if any, default values, ... Some of such values could be overridden at a finer granularity (e.g. on a specific object in the Data Storage)

Returns:
- configuration information

updateConfiguration

void updateConfiguration(Properties newConfiguration)
                         throws DataStorageException
Provides a way to change configuration parameters at the Data Storage level. For instance, change the data replication policy.

Parameters:
newConfiguration - - the new configuration settings
Throws:
when - configuration conflicts are detected
DataStorageException

getStatistics

Map<String,Object> getStatistics()
                                 throws IOException
Provides statistics on the Storage: capacity values, how much storage is in use...

Returns:
statistics on the Data Storage
Throws:
IOException

asElement

ElementDescriptor asElement(String name)
                            throws DataStorageException
Creates an entity handle for an object (no containment relation) from a String

Parameters:
name - of the object
Returns:
an object descriptor
Throws:
DataStorageException - if name does not conform to naming convention enforced by the Data Storage.

asElement

ElementDescriptor asElement(ElementDescriptor element)
                            throws DataStorageException
Throws:
DataStorageException

asElement

ElementDescriptor asElement(String parent,
                            String child)
                            throws DataStorageException
Throws:
DataStorageException

asElement

ElementDescriptor asElement(ContainerDescriptor parent,
                            String child)
                            throws DataStorageException
Throws:
DataStorageException

asElement

ElementDescriptor asElement(ContainerDescriptor parent,
                            ElementDescriptor child)
                            throws DataStorageException
Throws:
DataStorageException

isContainer

boolean isContainer(String name)
                    throws DataStorageException
Throws:
DataStorageException

asContainer

ContainerDescriptor asContainer(String name)
                                throws DataStorageException
Created an entity handle for a container.

Parameters:
name - of the container
Returns:
a container descriptor
Throws:
DataStorageException - if name does not conform to naming convention enforced by the Data Storage.

asContainer

ContainerDescriptor asContainer(ContainerDescriptor container)
                                throws DataStorageException
Throws:
DataStorageException

asContainer

ContainerDescriptor asContainer(String parent,
                                String child)
                                throws DataStorageException
Throws:
DataStorageException

asContainer

ContainerDescriptor asContainer(ContainerDescriptor parent,
                                String child)
                                throws DataStorageException
Throws:
DataStorageException

asContainer

ContainerDescriptor asContainer(ContainerDescriptor parent,
                                ContainerDescriptor child)
                                throws DataStorageException
Throws:
DataStorageException

asCollection

ElementDescriptor[] asCollection(String pattern)
                                 throws DataStorageException
Throws:
DataStorageException

setActiveContainer

void setActiveContainer(ContainerDescriptor container)

getActiveContainer

ContainerDescriptor getActiveContainer()


Copyright © 2007-2012 The Apache Software Foundation