Java Code Examples for org.apache.flink.api.common.io.statistics.BaseStatistics#NUM_RECORDS_UNKNOWN

The following examples show how to use org.apache.flink.api.common.io.statistics.BaseStatistics#NUM_RECORDS_UNKNOWN . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SourceInputFormat.java    From beam with Apache License 2.0 5 votes vote down vote up
@Override
public BaseStatistics getStatistics(BaseStatistics baseStatistics) throws IOException {
  try {
    final long estimatedSize = initialSource.getEstimatedSizeBytes(options);

    return new BaseStatistics() {
      @Override
      public long getTotalInputSize() {
        return estimatedSize;
      }

      @Override
      public long getNumberOfRecords() {
        return BaseStatistics.NUM_RECORDS_UNKNOWN;
      }

      @Override
      public float getAverageRecordWidth() {
        return BaseStatistics.AVG_RECORD_BYTES_UNKNOWN;
      }
    };
  } catch (Exception e) {
    LOG.warn("Could not read Source statistics: {}", e);
  }

  return null;
}
 
Example 2
Source File: SourceInputFormat.java    From flink-dataflow with Apache License 2.0 5 votes vote down vote up
@Override
public BaseStatistics getStatistics(BaseStatistics baseStatistics) throws IOException {
	try {
		final long estimatedSize = initialSource.getEstimatedSizeBytes(options);

		return new BaseStatistics() {
			@Override
			public long getTotalInputSize() {
				return estimatedSize;

			}

			@Override
			public long getNumberOfRecords() {
				return BaseStatistics.NUM_RECORDS_UNKNOWN;
			}

			@Override
			public float getAverageRecordWidth() {
				return BaseStatistics.AVG_RECORD_BYTES_UNKNOWN;
			}
		};
	} catch (Exception e) {
		LOG.warn("Could not read Source statistics: {}", e);
	}

	return null;
}
 
Example 3
Source File: StanfordTweetsDataSetInputFormat.java    From flink-examples with MIT License 4 votes vote down vote up
@Override
public long getNumberOfRecords() {
    return BaseStatistics.NUM_RECORDS_UNKNOWN;
}