|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ning.metrics.goodwill.access.GoodwillSchema
public class GoodwillSchema
Describe a Schema in Goodwill. This is basically a union of a Schema and extra metadata for the Sink.
Schema
Field Summary | |
---|---|
static String |
JSON_THRIFT_TYPE_NAME
|
static String |
JSON_THRIFT_TYPE_SCHEMA
|
static String |
JSON_THRIFT_TYPE_SINK_ADD_INFO
|
Constructor Summary | |
---|---|
GoodwillSchema(String name,
List<GoodwillSchemaField> items)
Manual constructor, typically used by Goodwill stores. |
|
GoodwillSchema(String name,
List<GoodwillSchemaField> items,
String sinkAddInfo)
Jackson constructor { "sinkAddInfo": null, "name": "hello", "schema": [ { "name": "my hello attribute", "type": "string", "position": 1, "description": "awesome attribute", "sql": { "type": "nvarchar", "length": null, "scale": null, "precision": null } }, { "name": "dsfdfsfds", "type": "bool", "position": 2, "description": "dfsfdsfds", "sql": { "type": "boolean", "length": null, "scale": null, "precision": null } }, { "name": "wer", "type": "double", "position": 3, "description": "wer", "sql": { "type": "numeric", "length": null, "scale": 12, "precision": 42 } } ] } |
Method Summary | |
---|---|
void |
addThriftField(GoodwillSchemaField goodwillSchemaField)
Add a field in the Thrift. |
static GoodwillSchema |
decode(String thriftJson)
|
GoodwillSchemaField |
getFieldByName(String name)
Given a name, return the field matching the name. |
GoodwillSchemaField |
getFieldByPosition(short i)
Given a position, return the field at that position. |
String |
getName()
|
ArrayList<GoodwillSchemaField> |
getSchema()
Get the schema as a collection of fields. |
void |
setSinkAddInfo(String sinkAddInfo)
|
ByteArrayOutputStream |
toJSON()
Deprecated. Use 'toJSONBytes()' instead |
byte[] |
toJSONBytes()
|
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_TYPE_NAME
public static final String JSON_THRIFT_TYPE_SCHEMA
public static final String JSON_THRIFT_TYPE_SINK_ADD_INFO
Constructor Detail |
---|
public GoodwillSchema(String name, List<GoodwillSchemaField> items, String sinkAddInfo)
name
- Schema nameitems
- List of fieldssinkAddInfo
- extra information for the Sinkpublic GoodwillSchema(String name, List<GoodwillSchemaField> items)
name
- Schema nameitems
- List of fieldsMethod Detail |
---|
public static GoodwillSchema decode(String thriftJson) throws IOException
IOException
public com.google.common.collect.ImmutableMap toMap()
public void addThriftField(GoodwillSchemaField goodwillSchemaField)
goodwillSchemaField
- field to addpublic String getName()
public ArrayList<GoodwillSchemaField> getSchema()
public void setSinkAddInfo(String sinkAddInfo)
public GoodwillSchemaField getFieldByPosition(short i)
i
- position in the Thrift (start with 1)
public GoodwillSchemaField getFieldByName(String name)
name
- GoodwillSchemaField name
public String toString()
toString
in class Object
public byte[] toJSONBytes() throws IOException
IOException
@Deprecated public ByteArrayOutputStream toJSON() throws IOException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |