Comments (6)
Attila Balga commented
This issue is closely related to issues BATCH-16 and BATCH-21.
There are primarily 2 things to solve:
-
how to design file handling
- 3 solutions identified by us:
a. Use FileUtils class: this utility class is not extendable, contains a static method handling file creation/update.
This solution is currently implemented.
b. Redesign FileUtils as an abstract class - AbstractFileOutputSource:
all FileOutputSource classes like StaxFileOutputSource and FlatFileOutputsource will extend this class.
A possible problem might be that all the file input sources will inherit the same implementation when it is in place,
even if they do not need it, or the needed handling strategy might sometimes vary between particular sources.
c. Use the strategy pattern - the file handling concerns will be accessed through a strategy interface using a default injected
implementation from a strategy host class into the particular output sources
(Joshua Bloch, Effective Java, Programming Language Guide, July 2005, pg.115).
A resource wrapper - like it exists in the SplittableFlatFileOutputSource might implement a strategy of choosing a right output file name,
so for an implicit case a user do not need to bother with it. - 3 solutions identified by us:
-
what kind of functionality will be supported
- a setUpOutputFile method will handle flags:
a. restarted
b. overwriteOutputFile
c. generateUniqueFileName
Handling of a restartable job is already solved.
For a non restartable one there are 2 possibilities - at restart if file exists and overwriteOutputFile is false:
aa. throw an exception if generateNewFileName is false
bb. create a file with a new filename using strategy in the resource wrapper (use timestamp)
For overwriteOutputFile = true the output file will be just overwritten as for restartable jobs. - a setUpOutputFile method will handle flags:
from spring-batch.
Attila Balga commented
Sorry for the formatting, the JIRA screwed the spacing up a bit after submit.
from spring-batch.
Lucas Ward commented
This issue is pretty well handled in the current release. The only major refactorings that could happen would require too big of changes for 1.1, so I'm moving to 2.0.
from spring-batch.
Robert Kasanicky commented
'Approach has been determined' long ago and is implemented consistently using the FileUtils class - I don't think we need to do anything more here.
from spring-batch.
Robert Kasanicky commented
reassigned for review
from spring-batch.
Lucas Ward commented
I agree, closing.
from spring-batch.
Related Issues (20)
- Improve recommendations for indexing metadata tables
- Incorrect deprecation in MongoPagingItemReader
- Schema Migration with Flyway HOT 2
- DELETE CASCADE on Foreign Keys
- Spring Batch step write_count less than read_count and filter and skip counts are all zero HOT 1
- Incorrect Chunk property value in implementation of ItemWriter write method HOT 3
- 5.1.2 Backported issues
- 5.0.6 Backported issues
- remote partitioning doesn't work if you're using graalvm
- Access Job Description
- Kotlin data class support for `FlatFileItemReaderBuilder`
- Deserialization of JobParameters throws exception
- Default value for ignoreWarnings in JdbcCursorItemReaderBuilder does not align with documentation HOT 1
- JdbcPagingItemReader - When using sortKeys with alias, I think it should paging by column name rather than alias in the select clause.
- MockStatic and MockConstruction not working in spring batch test cases HOT 1
- ListItemWriter<T>::getWrittenItems has bad wildcard return type HOT 1
- Data class support in JdbcCursorItemReaderBuilder & JdbcPagingItemReaderBuilder HOT 1
- Discrepancy in Thread Safety Documentation for AbstractPagingItemReader Subclasses
- Improve Error Messages in JobParametersBuilder methods
- The table field type in the SQL Server database is ntext and synchronized to the Oracle database, resulting in invalid column types in the corresponding NCLOB
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-batch.