Package org.apache.flink.api.common.io
Class FileInputFormat.FileBaseStatistics
- java.lang.Object
-
- org.apache.flink.api.common.io.FileInputFormat.FileBaseStatistics
-
- All Implemented Interfaces:
BaseStatistics
- Enclosing class:
- FileInputFormat<OT>
public static class FileInputFormat.FileBaseStatistics extends Object implements BaseStatistics
Encapsulation of the basic statistics the optimizer obtains about a file. Contained are the size of the file and the average bytes of a single record. The statistics also have a time-stamp that records the modification time of the file and indicates as such for which time the statistics were valid.
-
-
Field Summary
Fields Modifier and Type Field Description protected float
avgBytesPerRecord
protected long
fileModTime
protected long
fileSize
-
Fields inherited from interface org.apache.flink.api.common.io.statistics.BaseStatistics
AVG_RECORD_BYTES_UNKNOWN, NUM_RECORDS_UNKNOWN, SIZE_UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description FileBaseStatistics(long fileModTime, long fileSize, float avgBytesPerRecord)
Creates a new statistics object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getAverageRecordWidth()
Gets the estimated average number of bytes per record.long
getLastModificationTime()
Gets the timestamp of the last modification.long
getNumberOfRecords()
Gets the estimates number of records in the file, computed as the file size divided by the average record width, rounded up.long
getTotalInputSize()
Gets the file size.String
toString()
-
-
-
Constructor Detail
-
FileBaseStatistics
public FileBaseStatistics(long fileModTime, long fileSize, float avgBytesPerRecord)
Creates a new statistics object.- Parameters:
fileModTime
- The timestamp of the latest modification of any of the involved files.fileSize
- The size of the file, in bytes.-1
, if unknown.avgBytesPerRecord
- The average number of byte in a record, or-1.0f
, if unknown.
-
-
Method Detail
-
getLastModificationTime
public long getLastModificationTime()
Gets the timestamp of the last modification.- Returns:
- The timestamp of the last modification.
-
getTotalInputSize
public long getTotalInputSize()
Gets the file size.- Specified by:
getTotalInputSize
in interfaceBaseStatistics
- Returns:
- The fileSize.
- See Also:
BaseStatistics.getTotalInputSize()
-
getNumberOfRecords
public long getNumberOfRecords()
Gets the estimates number of records in the file, computed as the file size divided by the average record width, rounded up.- Specified by:
getNumberOfRecords
in interfaceBaseStatistics
- Returns:
- The estimated number of records in the file.
- See Also:
BaseStatistics.getNumberOfRecords()
-
getAverageRecordWidth
public float getAverageRecordWidth()
Gets the estimated average number of bytes per record.- Specified by:
getAverageRecordWidth
in interfaceBaseStatistics
- Returns:
- The average number of bytes per record.
- See Also:
BaseStatistics.getAverageRecordWidth()
-
-