|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.datasalt.pangool.io.Schema.Field
public static class Schema.Field
A field is an abstract data type that can be one of this:
Nested Class Summary | |
---|---|
static interface |
Schema.Field.FieldConfigurable
Interface that allows to receive ITuple field's metadata. |
static class |
Schema.Field.Type
|
Field Summary | |
---|---|
static String |
METADATA_BYTES_AS_OBJECT
|
static String |
METADATA_DEFAULT_VALUE
|
static String |
METADATA_OBJECT_CLASS
|
static String |
METADATA_OBJECT_SERIALIZATION
|
static Set<String> |
RESERVED_KEYWORDS
|
Method Summary | |
---|---|
void |
addProp(String key,
String value)
|
static Schema.Field |
cloneField(Schema.Field field,
String newName)
Clones a Field with a new name. |
static Schema.Field |
cloneField(Schema.Field field,
String newName,
boolean nullable)
Clones a Field with a new name. |
static Schema.Field |
create(String name,
Schema.Field.Type type)
Crates a non nullable field of the given type. |
static Schema.Field |
create(String name,
Schema.Field.Type type,
boolean nullable)
Crates a field of the given type. |
static Schema.Field |
create(String name,
Schema.Field.Type type,
boolean nullable,
Object defaultValue)
Crates a field of the given type. |
static Schema.Field |
createEnum(String name,
Class<?> clazz)
Creates a non-nullable enum field, based in a enum class |
static Schema.Field |
createEnum(String name,
Class<?> clazz,
boolean nullable)
Creates an enum field, based in a enum class |
static Schema.Field |
createEnum(String name,
Class<?> clazz,
boolean nullable,
Object defaultValue)
Creates an enum field, based in a enum class |
static Schema.Field |
createObject(String name,
Class<?> clazz)
Creates a non nullable object field. |
static Schema.Field |
createObject(String name,
Class<?> clazz,
boolean nullable)
Creates an object field. |
static Schema.Field |
createTupleField(String name,
Schema schema)
Creates a non-nullable field containing a Pangool Tuple. |
static Schema.Field |
createTupleField(String name,
Schema schema,
boolean nullable)
Creates a field containing a Pangool Tuple. |
boolean |
equals(Object a)
|
Object |
getDefaultValue()
|
String |
getName()
|
Class<?> |
getObjectClass()
|
Class<? extends org.apache.hadoop.io.serializer.Serialization> |
getObjectSerialization()
|
String |
getProp(String name)
|
Map<String,String> |
getProps()
|
Schema.Field.Type |
getType()
|
int |
hashCode()
|
boolean |
isNullable()
|
void |
setObjectSerialization(Class<? extends org.apache.hadoop.io.serializer.Serialization> serialization)
Sets custom serialization for fields with type OBJECT. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Set<String> RESERVED_KEYWORDS
public static final String METADATA_OBJECT_CLASS
public static final String METADATA_OBJECT_SERIALIZATION
public static final String METADATA_BYTES_AS_OBJECT
public static final String METADATA_DEFAULT_VALUE
Method Detail |
---|
public void addProp(String key, String value)
public Map<String,String> getProps()
public String getProp(String name)
public static Schema.Field create(String name, Schema.Field.Type type, boolean nullable, Object defaultValue)
name
- Field's nametype
- Schema.Field.Type
of the fieldnullable
- True if null values are allowed for this fielddefaultValue
- The default value for this field if the field is missing in some read schemapublic static Schema.Field create(String name, Schema.Field.Type type, boolean nullable)
name
- Field's nametype
- Schema.Field.Type
of the fieldnullable
- True if null values are allowed for this fieldpublic static Schema.Field create(String name, Schema.Field.Type type)
name
- Field's nametype
- Schema.Field.Type
of the fieldpublic static Schema.Field createObject(String name, Class<?> clazz, boolean nullable)
name
- Field's nameclazz
- Object's instance classnullable
- True if null values are allowed for this fieldpublic static Schema.Field createObject(String name, Class<?> clazz)
name
- Field's nameclazz
- Object's instance class
public static Schema.Field createTupleField(String name, Schema schema, boolean nullable)
name
- Field's nameschema
- The schema of the fieldnullable
- True if null values are allowed for this field
public static Schema.Field createTupleField(String name, Schema schema)
name
- Field's nameschema
- The schema of the field
public static Schema.Field cloneField(Schema.Field field, String newName, boolean nullable)
field
- The field to clone.newName
- The new name of the field.nullable
- If the new field must be nullable or not
public static Schema.Field cloneField(Schema.Field field, String newName)
field
- The field to clone.newName
- The new name of the field.
public static Schema.Field createEnum(String name, Class<?> clazz, boolean nullable, Object defaultValue)
name
- Field's nameclazz
- Enum classnullable
- True if null values are allowed for this field.defaultValue
- The defaultValue to assign if this field is not present in some read schema.
public static Schema.Field createEnum(String name, Class<?> clazz, boolean nullable)
name
- Field's nameclazz
- Enum classnullable
- True if null values are allowed for this field.
public static Schema.Field createEnum(String name, Class<?> clazz)
name
- Field's nameclazz
- Enum class
public Object getDefaultValue()
public Schema.Field.Type getType()
public String getName()
public Class<?> getObjectClass()
public boolean isNullable()
public Class<? extends org.apache.hadoop.io.serializer.Serialization> getObjectSerialization()
public void setObjectSerialization(Class<? extends org.apache.hadoop.io.serializer.Serialization> serialization)
Schema.Field.FieldConfigurable
then the field's metadata (properties) is passed to the instance allowing stateful
serialization.
public boolean equals(Object a)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |