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)
- Should ClassifierCompositeItemWriter use covariance (extends "keyword" instead "super") in the output type of classifier property?
- Add possibility to configure line separator for RecursiveCollectionLineAggregator HOT 2
- Allow defining the Job level on @JobScope when we are using parent and child jobs (JobStepBuilder)
- Memory leak in MessageChannelPartitionHandler when polling the database HOT 2
- 5.1.3 Backported issues
- Regression in Javadoc deployment path with 5.1.2 HOT 2
- Use '@EnableBatchProcessing' carefully on Spring Boot3. HOT 2
- AggregateMongoItemReader to perform mongoDb aggregations
- CustomJobRepository
- No @FunctionalInterface in JobKeyGenerator
- Repeating 'the the' exists
- Is it correct for isNonDefaultExitStatus to return true when status is null?
- #{stepExecutionContext[''] value same among partitioned threads on batch restart/resubmit.
- When an parameter with empty value is provided, `DefaultJobParametersConverter` fails with not user-friendly message.
- Add DatabaseType POSTGRES for the product name EnterpriseDB
- One more chunk will be executed even if a job is stopped
- Support registrating listener with multiple interface implementation HOT 1
- Link to batch reference documentation on project page is incorrect
- Chunck Monitor always report a warn about restarting, even if restart is desactivated
- Issue with Sort Keys and Case Sensitivity in Spring Batch with PostgreSQL
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.