batchee-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romain Manni-Bucau (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (BATCHEE-70) upgrade to jsefa 1.1.1
Date Thu, 19 Nov 2015 18:09:11 GMT

     [ https://issues.apache.org/jira/browse/BATCHEE-70?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Romain Manni-Bucau updated BATCHEE-70:
--------------------------------------
    Description: 
Seems jsefa 1.1.1 is on central, task is to:

- check license is still compatible with apache
- upgrade our version in our extension
- add header support for csv (and maybe more)

if it can help on the last point I used in a project:

{code}
public class JSefaWriterWithHead extends JSefaCsvWriter {
    @Inject
    @BatchProperty
    private String header;

    @Inject
    @BatchProperty
    private String headerLineBreak;

    @Override
    public void open(final Serializable checkpoint) throws Exception {
        super.open(checkpoint);
        if (isEmptyFile(checkpoint)) {
            transactionalWriter.write(header + ofNullable(headerLineBreak).orElse("\n"));
        }
    }

    private boolean isEmptyFile(final Serializable checkpoint) {
        return checkpoint == null || Number.class.isInstance(checkpoint) && Number.class.cast(checkpoint).longValue()
== 0;
    }
}
{code}

  was:
Seems jsefa 1.1.1 is on central, task is to:

- check license is still compatible with apache
- upgrade our version in our extension
- add header support for csv (and maybe more)


> upgrade to jsefa 1.1.1
> ----------------------
>
>                 Key: BATCHEE-70
>                 URL: https://issues.apache.org/jira/browse/BATCHEE-70
>             Project: BatchEE
>          Issue Type: Improvement
>            Reporter: Romain Manni-Bucau
>
> Seems jsefa 1.1.1 is on central, task is to:
> - check license is still compatible with apache
> - upgrade our version in our extension
> - add header support for csv (and maybe more)
> if it can help on the last point I used in a project:
> {code}
> public class JSefaWriterWithHead extends JSefaCsvWriter {
>     @Inject
>     @BatchProperty
>     private String header;
>     @Inject
>     @BatchProperty
>     private String headerLineBreak;
>     @Override
>     public void open(final Serializable checkpoint) throws Exception {
>         super.open(checkpoint);
>         if (isEmptyFile(checkpoint)) {
>             transactionalWriter.write(header + ofNullable(headerLineBreak).orElse("\n"));
>         }
>     }
>     private boolean isEmptyFile(final Serializable checkpoint) {
>         return checkpoint == null || Number.class.isInstance(checkpoint) && Number.class.cast(checkpoint).longValue()
== 0;
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message