public abstract class HPath extends Object implements ElementDescriptor
Modifier and Type | Field and Description |
---|---|
protected HDataStorage |
fs |
protected org.apache.hadoop.fs.Path |
path |
BLOCK_REPLICATION_KEY, BLOCK_SIZE_KEY, LENGTH_KEY, MODIFICATION_TIME_KEY
Constructor and Description |
---|
HPath(HDataStorage fs,
org.apache.hadoop.fs.Path path) |
HPath(HDataStorage fs,
org.apache.hadoop.fs.Path parent,
org.apache.hadoop.fs.Path child) |
HPath(HDataStorage fs,
org.apache.hadoop.fs.Path parent,
String child) |
HPath(HDataStorage fs,
String pathString) |
HPath(HDataStorage fs,
String parent,
org.apache.hadoop.fs.Path child) |
HPath(HDataStorage fs,
String parent,
String child) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ElementDescriptor other) |
void |
copy(ElementDescriptor dstName,
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() |
abstract OutputStream |
create(Properties configuration)
Opens a stream onto which an entity can be written to.
|
void |
delete()
Remove entity from the Data Storage.
|
boolean |
equals(Object obj) |
boolean |
exists()
Checks whether the entity exists or not
|
Properties |
getConfiguration()
Retrieve configuration information for entity
|
DataStorage |
getDataStorage() |
org.apache.hadoop.fs.FileSystem |
getHFS() |
org.apache.hadoop.fs.Path |
getPath() |
Map<String,Object> |
getStatistics()
List entity statistics
|
int |
hashCode() |
abstract InputStream |
open() |
void |
rename(ElementDescriptor newName)
Changes the name of an entity in the Data Storage
|
void |
setPermission(org.apache.hadoop.fs.permission.FsPermission permission) |
abstract SeekableInputStream |
sopen() |
boolean |
systemElement()
Defines whether the element is visible to users or
contains system's metadata
|
String |
toString() |
void |
updateConfiguration(Properties newConfig)
Update configuration information for this entity
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
open, sopen
protected org.apache.hadoop.fs.Path path
protected HDataStorage fs
public HPath(HDataStorage fs, org.apache.hadoop.fs.Path parent, org.apache.hadoop.fs.Path child)
public HPath(HDataStorage fs, String parent, String child)
public HPath(HDataStorage fs, org.apache.hadoop.fs.Path parent, String child)
public HPath(HDataStorage fs, String parent, org.apache.hadoop.fs.Path child)
public HPath(HDataStorage fs, String pathString)
public HPath(HDataStorage fs, org.apache.hadoop.fs.Path path)
public DataStorage getDataStorage()
getDataStorage
in interface ElementDescriptor
public abstract OutputStream create(Properties configuration) throws IOException
ElementDescriptor
create
in interface ElementDescriptor
configuration
- information at the object levelDataStorageException
IOException
public void copy(ElementDescriptor dstName, Properties dstConfiguration, boolean removeSrc) throws IOException
ElementDescriptor
copy
in interface ElementDescriptor
dstName
- name of entity to createdstConfiguration
- configuration for the new entityremoveSrc
- if src entity needs to be removed after copying itDataStorageException
- 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
public abstract InputStream open() throws IOException
open
in interface ElementDescriptor
IOException
public abstract SeekableInputStream sopen() throws IOException
sopen
in interface ElementDescriptor
IOException
public boolean exists() throws IOException
ElementDescriptor
exists
in interface ElementDescriptor
IOException
public void rename(ElementDescriptor newName) throws IOException
ElementDescriptor
rename
in interface ElementDescriptor
newName
- new name of entityDataStorageException
IOException
public void delete() throws IOException
ElementDescriptor
delete
in interface ElementDescriptor
DataStorageException
IOException
public void setPermission(org.apache.hadoop.fs.permission.FsPermission permission) throws IOException
IOException
public Properties getConfiguration() throws IOException
ElementDescriptor
getConfiguration
in interface ElementDescriptor
IOException
public void updateConfiguration(Properties newConfig) throws IOException
ElementDescriptor
updateConfiguration
in interface ElementDescriptor
newConfig
- configurationDataStorageException
IOException
public Map<String,Object> getStatistics() throws IOException
ElementDescriptor
getStatistics
in interface ElementDescriptor
IOException
public OutputStream create() throws IOException
create
in interface ElementDescriptor
IOException
public void copy(ElementDescriptor dstName, boolean removeSrc) throws IOException
copy
in interface ElementDescriptor
IOException
public org.apache.hadoop.fs.Path getPath()
public org.apache.hadoop.fs.FileSystem getHFS()
public boolean systemElement()
ElementDescriptor
systemElement
in interface ElementDescriptor
public int compareTo(ElementDescriptor other)
compareTo
in interface Comparable<ElementDescriptor>
Copyright © 2007-2012 The Apache Software Foundation