org.apache.falcon.entity
Class CatalogStorage

java.lang.Object
  extended by org.apache.falcon.entity.CatalogStorage
All Implemented Interfaces:
Storage

public class CatalogStorage
extends Object
implements Storage

A catalog registry implementation of a feed storage.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.falcon.entity.Storage
Storage.TYPE
 
Field Summary
static String CATALOG_URL
           
static String INPUT_PATH_SEPARATOR
           
static String OUTPUT_PATH_SEPARATOR
           
static String PARTITION_KEYVAL_SEPARATOR
           
static String PARTITION_SEPARATOR
           
static String PARTITION_VALUE_QUOTE
           
 
Fields inherited from interface org.apache.falcon.entity.Storage
DOLLAR_EXPR_START_NORMALIZED, DOLLAR_EXPR_START_REGEX, EXPR_CLOSE_NORMALIZED, EXPR_CLOSE_REGEX, QUESTION_EXPR_START_REGEX
 
Constructor Summary
protected CatalogStorage(org.apache.falcon.entity.v0.cluster.Cluster cluster, org.apache.falcon.entity.v0.feed.CatalogTable table)
           
protected CatalogStorage(org.apache.falcon.entity.v0.feed.Feed feed)
           
protected CatalogStorage(String uriTemplate)
          Create an instance from the URI Template that was generated using the getUriTemplate() method.
protected CatalogStorage(String catalogUrl, org.apache.falcon.entity.v0.feed.CatalogTable table)
           
protected CatalogStorage(String catalogUrl, String tableUri)
           
 
Method Summary
 boolean exists()
          Check if the storage, filesystem location or catalog table exists.
 String getCatalogUrl()
           
 String getDatabase()
           
 String getDatedPartitionKey()
           
 Map<String,String> getPartitions()
           
 String getPartitionValue(String key)
           
 String getTable()
           
 Storage.TYPE getType()
          Return the type of storage.
 String getUriTemplate()
          LocationType does NOT matter here.
 String getUriTemplate(org.apache.falcon.entity.v0.feed.LocationType locationType)
          LocationType does NOT matter here.
 boolean hasPartition(String key)
           
 boolean isIdentical(Storage toCompareAgainst)
          Check for equality of this instance against the one in question.
 String toPartitionAsPath()
          Convert the partition map to path string.
 String toPartitionFilter()
          Convert the partition map to filter string.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PARTITION_SEPARATOR

public static final String PARTITION_SEPARATOR
See Also:
Constant Field Values

PARTITION_KEYVAL_SEPARATOR

public static final String PARTITION_KEYVAL_SEPARATOR
See Also:
Constant Field Values

INPUT_PATH_SEPARATOR

public static final String INPUT_PATH_SEPARATOR
See Also:
Constant Field Values

OUTPUT_PATH_SEPARATOR

public static final String OUTPUT_PATH_SEPARATOR
See Also:
Constant Field Values

PARTITION_VALUE_QUOTE

public static final String PARTITION_VALUE_QUOTE
See Also:
Constant Field Values

CATALOG_URL

public static final String CATALOG_URL
See Also:
Constant Field Values
Constructor Detail

CatalogStorage

protected CatalogStorage(org.apache.falcon.entity.v0.feed.Feed feed)
                  throws URISyntaxException
Throws:
URISyntaxException

CatalogStorage

protected CatalogStorage(org.apache.falcon.entity.v0.cluster.Cluster cluster,
                         org.apache.falcon.entity.v0.feed.CatalogTable table)
                  throws URISyntaxException
Throws:
URISyntaxException

CatalogStorage

protected CatalogStorage(String catalogUrl,
                         org.apache.falcon.entity.v0.feed.CatalogTable table)
                  throws URISyntaxException
Throws:
URISyntaxException

CatalogStorage

protected CatalogStorage(String catalogUrl,
                         String tableUri)
                  throws URISyntaxException
Throws:
URISyntaxException

CatalogStorage

protected CatalogStorage(String uriTemplate)
                  throws URISyntaxException
Create an instance from the URI Template that was generated using the getUriTemplate() method.

Parameters:
uriTemplate - the uri template from org.apache.falcon.entity.CatalogStorage#getUriTemplate
Throws:
URISyntaxException
Method Detail

getCatalogUrl

public String getCatalogUrl()

getDatabase

public String getDatabase()

getTable

public String getTable()

getPartitions

public Map<String,String> getPartitions()

getPartitionValue

public String getPartitionValue(String key)
Parameters:
key - partition key
Returns:
partition value

hasPartition

public boolean hasPartition(String key)
Parameters:
key - partition key
Returns:
if partitions map includes the key or not

getDatedPartitionKey

public String getDatedPartitionKey()

toPartitionFilter

public String toPartitionFilter()
Convert the partition map to filter string. Each key value pair is separated by ';'.

Returns:
filter string

toPartitionAsPath

public String toPartitionAsPath()
Convert the partition map to path string. Each key value pair is separated by '/'.

Returns:
path string

getType

public Storage.TYPE getType()
Description copied from interface: Storage
Return the type of storage.

Specified by:
getType in interface Storage
Returns:
storage type

getUriTemplate

public String getUriTemplate()
LocationType does NOT matter here.

Specified by:
getUriTemplate in interface Storage
Returns:
uri template

getUriTemplate

public String getUriTemplate(org.apache.falcon.entity.v0.feed.LocationType locationType)
LocationType does NOT matter here.

Specified by:
getUriTemplate in interface Storage
Parameters:
locationType - type of location, applies only to filesystem type
Returns:
uri template

exists

public boolean exists()
               throws FalconException
Description copied from interface: Storage
Check if the storage, filesystem location or catalog table exists. Filesystem location always returns true.

Specified by:
exists in interface Storage
Returns:
true if table exists else false
Throws:
FalconException - an exception

isIdentical

public boolean isIdentical(Storage toCompareAgainst)
                    throws FalconException
Description copied from interface: Storage
Check for equality of this instance against the one in question.

Specified by:
isIdentical in interface Storage
Parameters:
toCompareAgainst - instance to compare
Returns:
true if identical else false
Throws:
FalconException - an exception

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013-2014 Apache Software Foundation. All Rights Reserved.