public final class DataStoreTextWriterBuilder extends AbstractConfiguredAnnotationBuilder<SpringDataStoreWriterConfigs,DataStoreTextWriterConfigurer,DataStoreTextWriterBuilder> implements DataStoreTextWriterConfigurer
Constructor and Description |
---|
DataStoreTextWriterBuilder()
Instantiates a new data store writer builder.
|
DataStoreTextWriterBuilder(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
Instantiates a new data store writer builder.
|
Modifier and Type | Method and Description |
---|---|
DataStoreTextWriterConfigurer |
append(boolean append)
Specify if writer is allowed to do file append.
|
DataStoreTextWriterConfigurer |
basePath(org.apache.hadoop.fs.Path basePath)
Specify a writer's base path.
|
DataStoreTextWriterConfigurer |
basePath(java.lang.String basePath)
Specify a writer's base path.
|
DataStoreTextWriterConfigurer |
closeTimeout(long timeout)
Specify a writer's close timeout.
|
DataStoreTextWriterConfigurer |
codec(CodecInfo codec)
Specify a writer's compression coded.
|
DataStoreTextWriterConfigurer |
codec(Codecs codec)
Specify a writer's compression coded.
|
DataStoreTextWriterConfigurer |
codec(java.lang.String codec)
Specify a writer's compression coded.
|
DataStoreTextWriterConfigurer |
configuration(org.apache.hadoop.conf.Configuration configuration)
Specify a writer's Hadoop configuration.
|
DataStoreTextWriterConfigurer |
fileOpenAttempts(int attempts)
Specify a writer's max file open attempts.
|
DataStoreTextWriterConfigurer |
idleTimeout(long timeout)
Specify a writer's idle timeout.
|
DataStoreTextWriterConfigurer |
inWritingPrefix(java.lang.String prefix)
Specify a writer's in-use prefix.
|
DataStoreTextWriterConfigurer |
inWritingSuffix(java.lang.String suffix)
Specify a writer's in-use suffix.
|
DataStoreTextWriterConfigurer |
overwrite(boolean overwrite)
Specify if writer is allowed to overwrite files.
|
protected SpringDataStoreWriterConfigs |
performBuild()
Subclasses must implement this method to build the object that is being returned.
|
void |
setFileNamingStrategy(FileNamingStrategy fileNamingStrategy)
Sets the file naming strategy for this builder.
|
void |
setPartitionStrategy(PartitionStrategy<?,?> partitionStrategy)
Sets the partition strategy for this builder.
|
void |
setRolloverStrategy(RolloverStrategy rolloverStrategy)
Sets the rollover strategy for this builder.
|
NamingStrategyConfigurer |
withNamingStrategy()
Specify a writer's naming strategy.
|
PartitionStrategyConfigurer |
withPartitionStrategy()
Specify a writer's partition strategy.
|
RolloverStrategyConfigurer |
withRolloverStrategy()
Specify a writer's rollover strategy.
|
apply, apply, beforeConfigureMains, beforeConfigurePosts, beforeInit, doBuild, getConfigurer, getConfigurers, getOrApply, getOrBuild, getSharedObject, getSharedObjects, objectPostProcessor, postProcess, removeConfigurer, removeConfigurers, setSharedObject
build, getObject
public DataStoreTextWriterBuilder()
public DataStoreTextWriterBuilder(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
objectPostProcessor
- the object post processorprotected SpringDataStoreWriterConfigs performBuild() throws java.lang.Exception
AbstractConfiguredAnnotationBuilder
performBuild
in class AbstractConfiguredAnnotationBuilder<SpringDataStoreWriterConfigs,DataStoreTextWriterConfigurer,DataStoreTextWriterBuilder>
java.lang.Exception
public DataStoreTextWriterConfigurer configuration(org.apache.hadoop.conf.Configuration configuration)
DataStoreTextWriterConfigurer
public void configure(DataStoreTextWriterConfigurer writer) throws Exception { writer .configuration(new Configuration()); }
configuration
in interface DataStoreTextWriterConfigurer
configuration
- the hadoop configurationDataStoreTextWriterConfigurer
for chainingpublic DataStoreTextWriterConfigurer basePath(org.apache.hadoop.fs.Path basePath)
DataStoreTextWriterConfigurer
public void configure(DataStoreTextWriterConfigurer writer) throws Exception { writer .basePath(new Path("/my/path")); }
basePath
in interface DataStoreTextWriterConfigurer
basePath
- the pathDataStoreTextWriterConfigurer
for chainingpublic DataStoreTextWriterConfigurer basePath(java.lang.String basePath)
DataStoreTextWriterConfigurer
public void configure(DataStoreTextWriterConfigurer writer) throws Exception { writer .basePath("/my/path"); }
basePath
in interface DataStoreTextWriterConfigurer
basePath
- the pathDataStoreTextWriterConfigurer
for chainingpublic DataStoreTextWriterConfigurer codec(CodecInfo codec)
DataStoreTextWriterConfigurer
public void configure(DataStoreTextWriterConfigurer writer) throws Exception { writer .codec(Codecs.BZIP2.getCodecInfo()); }
codec
in interface DataStoreTextWriterConfigurer
codec
- the codecDataStoreTextWriterConfigurer
for chainingpublic DataStoreTextWriterConfigurer codec(java.lang.String codec)
DataStoreTextWriterConfigurer
public void configure(DataStoreTextWriterConfigurer writer) throws Exception { writer .codec("gzip"); }
codec
in interface DataStoreTextWriterConfigurer
codec
- the codecDataStoreTextWriterConfigurer
for chainingpublic DataStoreTextWriterConfigurer codec(Codecs codec)
DataStoreTextWriterConfigurer
public void configure(DataStoreTextWriterConfigurer writer) throws Exception { writer .codec(Codecs.BZIP2); }
codec
in interface DataStoreTextWriterConfigurer
codec
- the codecDataStoreTextWriterConfigurer
for chainingpublic DataStoreTextWriterConfigurer overwrite(boolean overwrite)
DataStoreTextWriterConfigurer
public void configure(DataStoreTextWriterConfigurer writer) throws Exception { writer .overwrite(false); }
overwrite
in interface DataStoreTextWriterConfigurer
overwrite
- enable overwriteDataStoreTextWriterConfigurer
for chainingpublic DataStoreTextWriterConfigurer append(boolean append)
DataStoreTextWriterConfigurer
public void configure(DataStoreTextWriterConfigurer writer) throws Exception { writer .append(false); }
append
in interface DataStoreTextWriterConfigurer
append
- enable append supportDataStoreTextWriterConfigurer
for chainingpublic DataStoreTextWriterConfigurer inWritingPrefix(java.lang.String prefix)
DataStoreTextWriterConfigurer
public void configure(DataStoreTextWriterConfigurer writer) throws Exception { writer .inWritingPrefix("myprefix"); }
inWritingPrefix
in interface DataStoreTextWriterConfigurer
prefix
- the in-writing prefixDataStoreTextWriterConfigurer
for chainingpublic DataStoreTextWriterConfigurer inWritingSuffix(java.lang.String suffix)
DataStoreTextWriterConfigurer
public void configure(DataStoreTextWriterConfigurer writer) throws Exception { writer .inWritingSuffix("mysuffix"); }
inWritingSuffix
in interface DataStoreTextWriterConfigurer
suffix
- the in-writing suffixDataStoreTextWriterConfigurer
for chainingpublic DataStoreTextWriterConfigurer idleTimeout(long timeout)
DataStoreTextWriterConfigurer
public void configure(DataStoreTextWriterConfigurer writer) throws Exception { writer .idleTimeout(60000); }
idleTimeout
in interface DataStoreTextWriterConfigurer
timeout
- the idle timeoutDataStoreTextWriterConfigurer
for chainingpublic DataStoreTextWriterConfigurer closeTimeout(long timeout)
DataStoreTextWriterConfigurer
public void configure(DataStoreTextWriterConfigurer writer) throws Exception { writer .closeTimeout(60000); }
closeTimeout
in interface DataStoreTextWriterConfigurer
timeout
- the close timeoutDataStoreTextWriterConfigurer
for chainingpublic DataStoreTextWriterConfigurer fileOpenAttempts(int attempts)
DataStoreTextWriterConfigurer
public void configure(DataStoreTextWriterConfigurer writer) throws Exception { writer .fileOpenAttempts(10); }
fileOpenAttempts
in interface DataStoreTextWriterConfigurer
attempts
- the attemps countDataStoreTextWriterConfigurer
for chainingpublic PartitionStrategyConfigurer withPartitionStrategy() throws java.lang.Exception
DataStoreTextWriterConfigurer
DefaultPartitionStrategyConfigurer
into current builder.
public void configure(DataStoreTextWriterConfigurer writer) throws Exception { writer .withPartitionStrategy() .map("spelexpression"); }
withPartitionStrategy
in interface DataStoreTextWriterConfigurer
PartitionStrategyConfigurer
for chainingjava.lang.Exception
- exceptionpublic NamingStrategyConfigurer withNamingStrategy() throws java.lang.Exception
DataStoreTextWriterConfigurer
DefaultNamingStrategyConfigurer
into current builder.
public void configure(DataStoreTextWriterConfigurer writer) throws Exception { writer .withNamingStrategy() .name("foo") .uuid() .rolling() .codec(); }
withNamingStrategy
in interface DataStoreTextWriterConfigurer
NamingStrategyConfigurer
for chainingjava.lang.Exception
- exceptionpublic RolloverStrategyConfigurer withRolloverStrategy() throws java.lang.Exception
DataStoreTextWriterConfigurer
DefaultRolloverStrategyConfigurer
into current builder.
public void configure(DataStoreTextWriterConfigurer writer) throws Exception { writer .withRolloverStrategy() .size("1M"); }
withRolloverStrategy
in interface DataStoreTextWriterConfigurer
RolloverStrategyConfigurer
for chainingjava.lang.Exception
- exceptionpublic void setPartitionStrategy(PartitionStrategy<?,?> partitionStrategy)
partitionStrategy
- the partition strategypublic void setFileNamingStrategy(FileNamingStrategy fileNamingStrategy)
fileNamingStrategy
- the new file naming strategypublic void setRolloverStrategy(RolloverStrategy rolloverStrategy)
rolloverStrategy
- the new rollover strategy