|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kitesdk.data.DatasetDescriptor.Builder
public static class DatasetDescriptor.Builder
A fluent builder to aid in the construction of DatasetDescriptor
s.
Constructor Summary | |
---|---|
DatasetDescriptor.Builder()
|
|
DatasetDescriptor.Builder(DatasetDescriptor descriptor)
Creates a Builder configured to copy descriptor , if it is not
modified. |
Method Summary | ||
---|---|---|
DatasetDescriptor |
build()
Build an instance of the configured dataset descriptor. |
|
DatasetDescriptor.Builder |
format(Format format)
Configure the dataset's format (optional). |
|
DatasetDescriptor.Builder |
format(String formatName)
Configure the dataset's format from a format name String (optional). |
|
DatasetDescriptor.Builder |
location(Path uri)
Configure the Dataset 's location (optional). |
|
DatasetDescriptor.Builder |
location(String uri)
Configure the Dataset 's location (optional). |
|
DatasetDescriptor.Builder |
location(URI uri)
Configure the Dataset 's location (optional). |
|
DatasetDescriptor.Builder |
partitionStrategy(PartitionStrategy partitionStrategy)
Configure the dataset's partitioning strategy (optional). |
|
DatasetDescriptor.Builder |
property(String name,
String value)
Add a key-value property to the descriptor. |
|
|
schema(Class<T> type)
Configure the dataset's schema via a Java class type. |
|
DatasetDescriptor.Builder |
schema(File file)
Configure the dataset's schema from a File . |
|
DatasetDescriptor.Builder |
schema(InputStream in)
Configure the dataset's schema from an InputStream . |
|
DatasetDescriptor.Builder |
schema(Schema schema)
Configure the dataset's schema. |
|
DatasetDescriptor.Builder |
schemaFromAvroDataFile(File file)
Configure the dataset's schema by using the schema from an existing Avro data file. |
|
DatasetDescriptor.Builder |
schemaFromAvroDataFile(InputStream in)
Configure the dataset's schema by using the schema from an existing Avro data file. |
|
DatasetDescriptor.Builder |
schemaFromAvroDataFile(URI uri)
Configure the dataset's schema by using the schema from an existing Avro data file. |
|
DatasetDescriptor.Builder |
schemaLiteral(String s)
Configure the dataset's schema from a String . |
|
DatasetDescriptor.Builder |
schemaUri(String uri)
Configure the Dataset 's schema from a String URI. |
|
DatasetDescriptor.Builder |
schemaUri(URI uri)
Configure the Dataset 's schema from a URI. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DatasetDescriptor.Builder()
public DatasetDescriptor.Builder(DatasetDescriptor descriptor)
descriptor
, if it is not
modified. This is intended to help callers copy and update descriptors
even though they are Immutable
.
descriptor
- A DatasetDescriptor
to copy settings fromMethod Detail |
---|
public DatasetDescriptor.Builder schema(Schema schema)
schema
, schemaLiteral
,
schemaUri
, or schemaFromAvroDataFile
.
public DatasetDescriptor.Builder schema(File file) throws IOException
File
. A schema is required,
and may be set using one of the methods: schema
,
schemaLiteral
, schemaUri
, or
schemaFromAvroDataFile
.
IOException
public DatasetDescriptor.Builder schema(InputStream in) throws IOException
InputStream
. It is the
caller's responsibility to close the InputStream
. A schema is
required, and may be set using one of the methods: schema
,
schemaLiteral
, schemaUri
, or
schemaFromAvroDataFile
.
IOException
public DatasetDescriptor.Builder schemaUri(URI uri) throws IOException
Dataset
's schema from a URI. A schema is required,
and may be set using one of the methods: schema
,
schemaLiteral
, schemaUri
, or
schemaFromAvroDataFile
.
uri
- a URI object for the schema's location.
MalformedURLException
- if uri
is not a valid URL
IOException
public DatasetDescriptor.Builder schemaUri(String uri) throws URISyntaxException, IOException
Dataset
's schema from a String URI. A schema is
required, and may be set using one of the methods: schema
,
schemaLiteral
, schemaUri
, or
schemaFromAvroDataFile
.
uri
- a String URI
URISyntaxException
- if uri
is not a valid URI
MalformedURLException
- if uri
is not a valid URL
IOException
public DatasetDescriptor.Builder schemaLiteral(String s)
String
. A schema is
required, and may be set using one of the methods: schema
,
schemaLiteral
, schemaUri
, or
schemaFromAvroDataFile
.
public <T> DatasetDescriptor.Builder schema(Class<T> type)
schema
,
schemaLiteral
, schemaUri
, or
schemaFromAvroDataFile
.
public DatasetDescriptor.Builder schemaFromAvroDataFile(File file) throws IOException
schema
, schemaLiteral
, schemaUri
, or
schemaFromAvroDataFile
.
IOException
public DatasetDescriptor.Builder schemaFromAvroDataFile(InputStream in) throws IOException
InputStream
. A schema is required, and may be set using one of
the methods: schema
, schemaLiteral
, schemaUri
,
or schemaFromAvroDataFile
.
IOException
public DatasetDescriptor.Builder schemaFromAvroDataFile(URI uri) throws IOException
schema
, schemaLiteral
, schemaUri
, or
schemaFromAvroDataFile
.
IOException
public DatasetDescriptor.Builder format(Format format)
Formats.AVRO
is used by default.
public DatasetDescriptor.Builder format(String formatName)
Formats.AVRO
will be used.
formatName
- a String format name
UnknownFormatException
- if the format name is not recognized.public DatasetDescriptor.Builder location(URI uri)
Dataset
's location (optional).
uri
- A URI location
public DatasetDescriptor.Builder location(Path uri)
Dataset
's location (optional).
uri
- A location Path
public DatasetDescriptor.Builder location(String uri) throws URISyntaxException
Dataset
's location (optional).
uri
- A location String URI
URISyntaxException
- if uri
is not a valid URIpublic DatasetDescriptor.Builder property(String name, String value)
name
- the property namevalue
- the property value
public DatasetDescriptor.Builder partitionStrategy(@Nullable PartitionStrategy partitionStrategy)
public DatasetDescriptor build()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |