package org.embulk.input.hdfs;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.Serializable;

public class TargetFileInfo
    implements Serializable
{
    // private static final long serialVersionUID = 1L; // to suppress warnings?
    private long start;
    private long end;
    private String pathString;
    private boolean isDecompressible;
    private boolean isPartitionable;

    @JsonCreator
    public TargetFileInfo(
            @JsonProperty("path_string") String pathString,
            @JsonProperty("start") long start,
            @JsonProperty("end") long end,
            @JsonProperty("is_decompressible") boolean isDecompressible,
            @JsonProperty("is_partitionable") boolean isPartitionable)
    {
        this.pathString = pathString;
        this.start = start;
        this.end = end;
        this.isDecompressible = isDecompressible;
        this.isPartitionable = isPartitionable;
    }

    @JsonProperty("start")
    public long getStart()
    {
        return start;
    }

    @JsonProperty("end")
    public long getEnd()
    {
        return end;
    }

    @JsonProperty("is_decompressible")
    public boolean getIsDecompressible()
    {
        return isDecompressible;
    }

    @JsonProperty("is_partitionable")
    public boolean getIsPartitionable()
    {
        return isPartitionable;
    }

    @JsonProperty("path_string")
    public String getPathString()
    {
        return pathString;
    }

    @JsonIgnore
    public long getSize()
    {
        return getEnd() - getStart();
    }
}

@@ -362,24 +362,30 @@
     private 
+final 
 long start;%0A
@@ -396,16 +396,22 @@
 private 
+final 
 long end
@@ -424,16 +424,22 @@
 private 
+final 
 String p
@@ -453,32 +453,38 @@
 ng;%0A    private 
+final 
 boolean isDecomp
@@ -505,16 +505,22 @@
 private 
+final 
 boolean 
@@ -535,16 +535,54 @@
 ionable;
+%0A    private final int numHeaderLines;
 %0A%0A    @J
@@ -911,16 +911,82 @@
 tionable
+,%0A            @JsonProperty(%22num_header_lines%22) int numHeaderLines
 )%0A    %7B%0A
@@ -1165,32 +1165,78 @@
 sPartitionable;%0A
+        this.numHeaderLines = numHeaderLines;%0A
     %7D%0A%0A    @Json
@@ -1767,46 +1767,284 @@
 Json
-Ignore%0A    public long getSize()%0A    %7B
+Property(%22num_header_lines%22)%0A    public int getNumHeaderLines()%0A    %7B%0A        return numHeaderLines;%0A    %7D%0A%0A    @JsonIgnore%0A    public long getSize()%0A    %7B%0A        // NOTE: this size is reference value which%0A        //       becomes smaller than raw if the file is compressed.
 %0A   

Add numHeaderLines prop to TargetFileInfo