org.apache.hadoop.hive.ql.metadata.formatting
Class JsonMetaDataFormatter

java.lang.Object
  extended by org.apache.hadoop.hive.ql.metadata.formatting.JsonMetaDataFormatter
All Implemented Interfaces:
MetaDataFormatter

public class JsonMetaDataFormatter
extends Object
implements MetaDataFormatter

Format table and index information for machine readability using json.


Field Summary
 
Fields inherited from interface org.apache.hadoop.hive.ql.metadata.formatting.MetaDataFormatter
CONFLICT, ERROR, MISSING
 
Constructor Summary
JsonMetaDataFormatter()
           
 
Method Summary
 void asJson(OutputStream out, Map<String,Object> data)
          Convert the map to a JSON string.
 void consoleError(SessionState.LogHelper console, String msg, int errorCode)
          Write a console error message.
 void consoleError(SessionState.LogHelper console, String msg, String detail, int errorCode)
          Write a console error message.
 void describeTable(DataOutputStream out, String colPath, String tableName, Table tbl, Partition part, List<FieldSchema> cols, boolean isFormatted, boolean isExt)
          Describe table.
 void error(OutputStream out, String msg, int errorCode)
          Write an error message.
 void logInfo(OutputStream out, String msg, int errorCode)
          Write a log info message.
 void logWarn(OutputStream out, String msg, int errorCode)
          Write a log warn message.
 void showDatabaseDescription(DataOutputStream out, String database, String comment, String location, Map<String,String> params)
          Show the description of a database
 void showDatabases(DataOutputStream out, List<String> databases)
          Show a list of databases
 void showTablePartitons(DataOutputStream out, List<String> parts)
          Show the table partitions.
 void showTables(DataOutputStream out, Set<String> tables)
          Show a list of tables.
 void showTableStatus(DataOutputStream out, Hive db, HiveConf conf, List<Table> tbls, Map<String,String> part, Partition par)
          Show the table status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonMetaDataFormatter

public JsonMetaDataFormatter()
Method Detail

asJson

public void asJson(OutputStream out,
                   Map<String,Object> data)
            throws HiveException
Convert the map to a JSON string.

Throws:
HiveException

error

public void error(OutputStream out,
                  String msg,
                  int errorCode)
           throws HiveException
Write an error message.

Specified by:
error in interface MetaDataFormatter
Throws:
HiveException

logWarn

public void logWarn(OutputStream out,
                    String msg,
                    int errorCode)
             throws HiveException
Write a log warn message.

Specified by:
logWarn in interface MetaDataFormatter
Throws:
HiveException

logInfo

public void logInfo(OutputStream out,
                    String msg,
                    int errorCode)
             throws HiveException
Write a log info message.

Specified by:
logInfo in interface MetaDataFormatter
Throws:
HiveException

consoleError

public void consoleError(SessionState.LogHelper console,
                         String msg,
                         int errorCode)
Write a console error message.

Specified by:
consoleError in interface MetaDataFormatter

consoleError

public void consoleError(SessionState.LogHelper console,
                         String msg,
                         String detail,
                         int errorCode)
Write a console error message.

Specified by:
consoleError in interface MetaDataFormatter

showTables

public void showTables(DataOutputStream out,
                       Set<String> tables)
                throws HiveException
Show a list of tables.

Specified by:
showTables in interface MetaDataFormatter
Throws:
HiveException

describeTable

public void describeTable(DataOutputStream out,
                          String colPath,
                          String tableName,
                          Table tbl,
                          Partition part,
                          List<FieldSchema> cols,
                          boolean isFormatted,
                          boolean isExt)
                   throws HiveException
Describe table.

Specified by:
describeTable in interface MetaDataFormatter
Throws:
HiveException

showTableStatus

public void showTableStatus(DataOutputStream out,
                            Hive db,
                            HiveConf conf,
                            List<Table> tbls,
                            Map<String,String> part,
                            Partition par)
                     throws HiveException
Description copied from interface: MetaDataFormatter
Show the table status.

Specified by:
showTableStatus in interface MetaDataFormatter
Throws:
HiveException

showTablePartitons

public void showTablePartitons(DataOutputStream out,
                               List<String> parts)
                        throws HiveException
Show the table partitions.

Specified by:
showTablePartitons in interface MetaDataFormatter
Throws:
HiveException

showDatabases

public void showDatabases(DataOutputStream out,
                          List<String> databases)
                   throws HiveException
Show a list of databases

Specified by:
showDatabases in interface MetaDataFormatter
Throws:
HiveException

showDatabaseDescription

public void showDatabaseDescription(DataOutputStream out,
                                    String database,
                                    String comment,
                                    String location,
                                    Map<String,String> params)
                             throws HiveException
Show the description of a database

Specified by:
showDatabaseDescription in interface MetaDataFormatter
Throws:
HiveException


Copyright © 2011 The Apache Software Foundation