com.nhncorp.neptune.tablet
Class TableSchema

java.lang.Object
  extended by com.nhncorp.neptune.tablet.TableSchema
All Implemented Interfaces:
NWritable, java.lang.Comparable<TableSchema>

public class TableSchema
extends java.lang.Object
implements NWritable, java.lang.Comparable<TableSchema>

테이블의 스키마 정보(ValueObject)

Author:
nhn

Field Summary
static int DEFAULT_NUM_VERSION
           
static java.lang.String DIR_TABLE
           
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
TableSchema()
           
TableSchema(java.lang.String tableName)
           
TableSchema(java.lang.String tableName, java.lang.String description)
           
TableSchema(java.lang.String tableName, java.lang.String description, java.util.List<java.lang.String> columns)
           
TableSchema(java.lang.String tableName, java.lang.String description, java.lang.String[] columns)
           
 
Method Summary
 void addColumn(java.lang.String column)
           
 void addPermission(java.lang.String userId, java.lang.String permission)
           
 int compareTo(TableSchema o)
           
 boolean containsColumn(java.lang.String[] targetColumns)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getColumn(int i)
           
 java.util.List<java.lang.String> getColumns()
           
 java.lang.String[] getColumnsArray()
           
 java.lang.String getDescription()
           
 int getNumOfVersion()
           
 java.lang.String getOwner()
           
 java.lang.String getOwnerInfo()
           
static java.lang.String getTableDataPath(NConfiguration conf, java.lang.String tableName)
           
static java.lang.String getTableDataTrashPath(NConfiguration conf, java.lang.String tableName)
           
 java.lang.String getTableDetail()
           
 java.lang.String getTableName()
           
static GPath getTableSchemaPath(NConfiguration conf, java.lang.String tableName)
           
 int hashCode()
           
 boolean hasPermission(java.lang.String userId, java.lang.String readWrite)
           
static TableSchema loadTableSchema(NConfiguration conf, java.lang.String tableName)
           
static void main(java.lang.String[] args)
           
 void print()
           
 void readFields(java.io.DataInput in)
          Reads the fields of this object from in.
 void removePermission(java.lang.String userId)
           
 void setColumns(java.util.List<java.lang.String> columns)
           
 void setDescription(java.lang.String description)
           
 void setNumOfVersion(int numOfVeriosn)
           
 void setOwner(java.lang.String owner)
           
 void setTableName(java.lang.String tableName)
           
 java.lang.String toString()
           
 void write(java.io.DataOutput out)
          Writes the fields of this object to out.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG

DEFAULT_NUM_VERSION

public static final int DEFAULT_NUM_VERSION
See Also:
Constant Field Values

DIR_TABLE

public static final java.lang.String DIR_TABLE
See Also:
Constant Field Values
Constructor Detail

TableSchema

public TableSchema()

TableSchema

public TableSchema(java.lang.String tableName)

TableSchema

public TableSchema(java.lang.String tableName,
                   java.lang.String description)

TableSchema

public TableSchema(java.lang.String tableName,
                   java.lang.String description,
                   java.util.List<java.lang.String> columns)

TableSchema

public TableSchema(java.lang.String tableName,
                   java.lang.String description,
                   java.lang.String[] columns)
Method Detail

addColumn

public void addColumn(java.lang.String column)

getColumns

public java.util.List<java.lang.String> getColumns()

setColumns

public void setColumns(java.util.List<java.lang.String> columns)

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

getTableName

public java.lang.String getTableName()

setTableName

public void setTableName(java.lang.String tableName)

getNumOfVersion

public int getNumOfVersion()

setNumOfVersion

public void setNumOfVersion(int numOfVeriosn)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

loadTableSchema

public static TableSchema loadTableSchema(NConfiguration conf,
                                          java.lang.String tableName)
                                   throws java.io.IOException
Throws:
java.io.IOException

getTableSchemaPath

public static GPath getTableSchemaPath(NConfiguration conf,
                                       java.lang.String tableName)

getOwnerInfo

public java.lang.String getOwnerInfo()
                              throws java.io.IOException
Throws:
java.io.IOException

readFields

public void readFields(java.io.DataInput in)
                throws java.io.IOException
Description copied from interface: NWritable
Reads the fields of this object from in. For efficiency, implementations should attempt to re-use storage in the existing object where possible.

Specified by:
readFields in interface NWritable
Throws:
java.io.IOException

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Description copied from interface: NWritable
Writes the fields of this object to out.

Specified by:
write in interface NWritable
Throws:
java.io.IOException

getColumn

public java.lang.String getColumn(int i)

getColumnsArray

public java.lang.String[] getColumnsArray()

containsColumn

public boolean containsColumn(java.lang.String[] targetColumns)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

print

public void print()

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

getTableDataPath

public static java.lang.String getTableDataPath(NConfiguration conf,
                                                java.lang.String tableName)

getTableDataTrashPath

public static java.lang.String getTableDataTrashPath(NConfiguration conf,
                                                     java.lang.String tableName)

compareTo

public int compareTo(TableSchema o)
Specified by:
compareTo in interface java.lang.Comparable<TableSchema>

getTableDetail

public java.lang.String getTableDetail()

getOwner

public java.lang.String getOwner()

setOwner

public void setOwner(java.lang.String owner)

hasPermission

public boolean hasPermission(java.lang.String userId,
                             java.lang.String readWrite)

addPermission

public void addPermission(java.lang.String userId,
                          java.lang.String permission)

removePermission

public void removePermission(java.lang.String userId)