Examples of BaseStatistics


Examples of org.apache.flink.api.common.io.statistics.BaseStatistics

      }
      catch (Throwable t) {}
     
      // first of all, get the statistics from the cache
      final String statisticsKey = getPactContract().getStatisticsKey();
      final BaseStatistics cachedStatistics = statistics.getBaseStatistics(statisticsKey);
     
      BaseStatistics bs = null;
      try {
        bs = format.getStatistics(cachedStatistics);
      }
      catch (Throwable t) {
        if (PactCompiler.LOG.isWarnEnabled()) {
          PactCompiler.LOG.warn("Error obtaining statistics from input format: " + t.getMessage(), t);
        }
      }
     
      if (bs != null) {
        final long len = bs.getTotalInputSize();
        if (len == BaseStatistics.SIZE_UNKNOWN) {
          if (PactCompiler.LOG.isInfoEnabled()) {
            PactCompiler.LOG.info("Compiler could not determine the size of input '" + inFormatDescription + "'. Using default estimates.");
          }
        }
        else if (len >= 0) {
          this.estimatedOutputSize = len;
        }
       
        final long card = bs.getNumberOfRecords();
        if (card != BaseStatistics.NUM_RECORDS_UNKNOWN) {
          this.estimatedNumRecords = card;
        }
      }
    }
View Full Code Here

Examples of org.apache.flink.api.common.io.statistics.BaseStatistics

   * Tests the statistics of the given format.
   */
  @Test
  public void checkStatistics() {
    SerializedInputFormat<Record> input = this.createInputFormat();
    BaseStatistics statistics = input.getStatistics(null);
    Assert.assertEquals(this.numberOfTuples, statistics.getNumberOfRecords());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.