|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ning.metrics.goodwill.access.GoodwillSchemaField
public class GoodwillSchemaField
Describe a SchemaField in Goodwill. This is basically the union of a SchemaField and extra metadata for the SQL sink.
SchemaField
Nested Class Summary | |
---|---|
static class |
GoodwillSchemaField.Sql
Extra information for the SQL Sink |
Field Summary | |
---|---|
static String |
JSON_THRIFT_FIELD_DESCRIPTION
|
static String |
JSON_THRIFT_FIELD_ID
|
static String |
JSON_THRIFT_FIELD_NAME
|
static String |
JSON_THRIFT_FIELD_SQL_KEY
|
static String |
JSON_THRIFT_FIELD_SQL_LENGTH
|
static String |
JSON_THRIFT_FIELD_SQL_PRECISION
|
static String |
JSON_THRIFT_FIELD_SQL_SCALE
|
static String |
JSON_THRIFT_FIELD_SQL_TYPE
|
static String |
JSON_THRIFT_FIELD_TYPE
|
Constructor Summary | |
---|---|
GoodwillSchemaField(com.ning.metrics.serialization.schema.SchemaField field)
|
|
GoodwillSchemaField(String name,
String type,
short id,
String description,
GoodwillSchemaField.Sql sql)
Jackson constructor { "name": "myField", "type": "string", "position": 1, "description": "string", "sql": { "type": "nvarchar", "length": 255, "scale": null, "precision": null } |
|
GoodwillSchemaField(String name,
String type,
short id,
String description,
String sqlType,
Integer sqlLength,
Integer sqlScale,
Integer sqlPrecision)
Manual constructor, typically used by Goodwill stores. |
Method Summary | |
---|---|
static GoodwillSchemaField |
decode(String thriftItemJson)
|
String |
getDescription()
|
String |
getFullSQLType()
Pretty print the SQL type. |
short |
getId()
|
String |
getName()
|
GoodwillSchemaField.Sql |
getSql()
|
com.ning.metrics.serialization.schema.SchemaFieldType |
getType()
|
ByteArrayOutputStream |
toJSON()
Create a JSON representation of the GoodwillSchemaField. |
com.google.common.collect.ImmutableMap |
toMap()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String JSON_THRIFT_FIELD_NAME
public static final String JSON_THRIFT_FIELD_TYPE
public static final String JSON_THRIFT_FIELD_ID
public static final String JSON_THRIFT_FIELD_DESCRIPTION
public static final String JSON_THRIFT_FIELD_SQL_KEY
public static final String JSON_THRIFT_FIELD_SQL_TYPE
public static final String JSON_THRIFT_FIELD_SQL_LENGTH
public static final String JSON_THRIFT_FIELD_SQL_SCALE
public static final String JSON_THRIFT_FIELD_SQL_PRECISION
Constructor Detail |
---|
public GoodwillSchemaField(String name, String type, short id, String description, GoodwillSchemaField.Sql sql)
name
- Schema field nametype
- Schema field type. This is not necessarily a Thrift type. @see SchemaFieldTypeid
- field positiondescription
- Short description of the fieldsql
- SQL object (used by the sink)public GoodwillSchemaField(String name, String type, short id, String description, String sqlType, Integer sqlLength, Integer sqlScale, Integer sqlPrecision)
name
- Schema field nametype
- Schema field type. This is not necessarily a Thrift type. @see SchemaFieldTypeid
- field positiondescription
- Short description of the fieldsqlType
- SQL type (varchar, int, ...)sqlLength
- SQL type lengthsqlScale
- SQL type scalesqlPrecision
- SQL type precisionpublic GoodwillSchemaField(com.ning.metrics.serialization.schema.SchemaField field)
Method Detail |
---|
public static GoodwillSchemaField decode(String thriftItemJson) throws IOException
IOException
public com.google.common.collect.ImmutableMap toMap()
public String getName()
public com.ning.metrics.serialization.schema.SchemaFieldType getType()
public short getId()
public GoodwillSchemaField.Sql getSql()
public String getDescription()
public String toString()
toString
in class Object
public ByteArrayOutputStream toJSON() throws IOException
IOException
- if a serialization exception occurs
org.codehaus.jackson.JsonGenerationException
- if a serialization exception occurspublic String getFullSQLType()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |