public abstract class HPath extends java.lang.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,
java.lang.String child) |
HPath(HDataStorage fs,
java.lang.String pathString) |
HPath(HDataStorage fs,
java.lang.String parent,
org.apache.hadoop.fs.Path child) |
HPath(HDataStorage fs,
java.lang.String parent,
java.lang.String child) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ElementDescriptor other) |
void |
copy(ElementDescriptor dstName,
boolean removeSrc) |
void |
copy(ElementDescriptor dstName,
java.util.Properties dstConfiguration,
boolean removeSrc)
Copy entity from an existing one, possibly residing in a
different Data Storage.
|
java.io.OutputStream |
create() |
abstract java.io.OutputStream |
create(java.util.Properties configuration)
Opens a stream onto which an entity can be written to.
|
void |
delete()
Remove entity from the Data Storage.
|
boolean |
equals(java.lang.Object obj) |
boolean |
exists()
Checks whether the entity exists or not
|
java.util.Properties |
getConfiguration()
Retrieve configuration information for entity
|
DataStorage |
getDataStorage() |
org.apache.hadoop.fs.FileSystem |
getHFS() |
org.apache.hadoop.fs.Path |
getPath() |
java.util.Map<java.lang.String,java.lang.Object> |
getStatistics()
List entity statistics
|
int |
hashCode() |
abstract java.io.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
|
java.lang.String |
toString() |
void |
updateConfiguration(java.util.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, java.lang.String parent, java.lang.String child)
public HPath(HDataStorage fs, org.apache.hadoop.fs.Path parent, java.lang.String child)
public HPath(HDataStorage fs, java.lang.String parent, org.apache.hadoop.fs.Path child)
public HPath(HDataStorage fs, java.lang.String pathString)
public HPath(HDataStorage fs, org.apache.hadoop.fs.Path path)
public DataStorage getDataStorage()
getDataStorage
in interface ElementDescriptor
public abstract java.io.OutputStream create(java.util.Properties configuration) throws java.io.IOException
ElementDescriptor
create
in interface ElementDescriptor
configuration
- information at the object levelDataStorageException
java.io.IOException
public void copy(ElementDescriptor dstName, java.util.Properties dstConfiguration, boolean removeSrc) throws java.io.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...java.io.IOException
public abstract java.io.InputStream open() throws java.io.IOException
open
in interface ElementDescriptor
java.io.IOException
public abstract SeekableInputStream sopen() throws java.io.IOException
sopen
in interface ElementDescriptor
java.io.IOException
public boolean exists() throws java.io.IOException
ElementDescriptor
exists
in interface ElementDescriptor
java.io.IOException
public void rename(ElementDescriptor newName) throws java.io.IOException
ElementDescriptor
rename
in interface ElementDescriptor
newName
- new name of entityDataStorageException
java.io.IOException
public void delete() throws java.io.IOException
ElementDescriptor
delete
in interface ElementDescriptor
DataStorageException
java.io.IOException
public void setPermission(org.apache.hadoop.fs.permission.FsPermission permission) throws java.io.IOException
java.io.IOException
public java.util.Properties getConfiguration() throws java.io.IOException
ElementDescriptor
getConfiguration
in interface ElementDescriptor
java.io.IOException
public void updateConfiguration(java.util.Properties newConfig) throws java.io.IOException
ElementDescriptor
updateConfiguration
in interface ElementDescriptor
newConfig
- configurationDataStorageException
java.io.IOException
public java.util.Map<java.lang.String,java.lang.Object> getStatistics() throws java.io.IOException
ElementDescriptor
getStatistics
in interface ElementDescriptor
java.io.IOException
public java.io.OutputStream create() throws java.io.IOException
create
in interface ElementDescriptor
java.io.IOException
public void copy(ElementDescriptor dstName, boolean removeSrc) throws java.io.IOException
copy
in interface ElementDescriptor
java.io.IOException
public org.apache.hadoop.fs.Path getPath()
public org.apache.hadoop.fs.FileSystem getHFS()
public boolean systemElement()
ElementDescriptor
systemElement
in interface ElementDescriptor
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int compareTo(ElementDescriptor other)
compareTo
in interface java.lang.Comparable<ElementDescriptor>
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2007-2012 The Apache Software Foundation