Package eu.stratosphere.api.common.io.FileInputFormat

Examples of eu.stratosphere.api.common.io.FileInputFormat.FileBaseStatistics


  public OptimizedPlan compileNoStats(Plan p) {
    return this.noStatsCompiler.compile(p, this.instanceType);
  }
 
  public void setSourceStatistics(GenericDataSourceBase<?, ?> source, long size, float recordWidth) {
    setSourceStatistics(source, new FileBaseStatistics(Long.MAX_VALUE, size, recordWidth));
  }
View Full Code Here


  public OptimizedPlan compileNoStats(Plan p) {
    return this.noStatsCompiler.compile(p, this.instanceType);
  }
 
  public void setSourceStatistics(GenericDataSourceBase<?, ?> source, long size, float recordWidth) {
    setSourceStatistics(source, new FileBaseStatistics(Long.MAX_VALUE, size, recordWidth));
  }
View Full Code Here

      DummyFileInputFormat format = new DummyFileInputFormat();
      format.setFilePath(tempFile);
      format.configure(new Configuration());
     
     
      FileBaseStatistics stats = format.getStatistics(null);
      Assert.assertEquals("The file size from the statistics is wrong.", SIZE, stats.getTotalInputSize());
     
      format = new DummyFileInputFormat();
      format.setFilePath(tempFile);
      format.configure(new Configuration());
     
      FileBaseStatistics newStats = format.getStatistics(stats);
      Assert.assertTrue("Statistics object was changed", newStats == stats);

      // insert fake stats with the correct modification time. the call should return the fake stats
      format = new DummyFileInputFormat();
      format.setFilePath(tempFile);
      format.configure(new Configuration());
     
      FileBaseStatistics fakeStats = new FileBaseStatistics(stats.getLastModificationTime(), FAKE_SIZE, BaseStatistics.AVG_RECORD_BYTES_UNKNOWN);
      BaseStatistics latest = format.getStatistics(fakeStats);
      Assert.assertEquals("The file size from the statistics is wrong.", FAKE_SIZE, latest.getTotalInputSize());
     
      // insert fake stats with the expired modification time. the call should return new accurate stats
      format = new DummyFileInputFormat();
      format.setFilePath(tempFile);
      format.configure(new Configuration());
     
      FileBaseStatistics outDatedFakeStats = new FileBaseStatistics(stats.getLastModificationTime()-1, FAKE_SIZE, BaseStatistics.AVG_RECORD_BYTES_UNKNOWN);
      BaseStatistics reGathered = format.getStatistics(outDatedFakeStats);
      Assert.assertEquals("The file size from the statistics is wrong.", SIZE, reGathered.getTotalInputSize());
     
    } catch (Exception ex) {
      ex.printStackTrace();
View Full Code Here

     
      DummyFileInputFormat format = new DummyFileInputFormat();
      format.setFilePath(tempDir);
      format.configure(new Configuration());
     
      FileBaseStatistics stats = format.getStatistics(null);
      Assert.assertEquals("The file size from the statistics is wrong.", TOTAL, stats.getTotalInputSize());
     
      format = new DummyFileInputFormat();
      format.setFilePath(tempDir);
      format.configure(new Configuration());
     
      FileBaseStatistics newStats = format.getStatistics(stats);
      Assert.assertTrue("Statistics object was changed", newStats == stats);

      // insert fake stats with the correct modification time. the call should return the fake stats
      format = new DummyFileInputFormat();
      format.setFilePath(tempDir);
      format.configure(new Configuration());
     
      FileBaseStatistics fakeStats = new FileBaseStatistics(stats.getLastModificationTime(), FAKE_SIZE, BaseStatistics.AVG_RECORD_BYTES_UNKNOWN);
      BaseStatistics latest = format.getStatistics(fakeStats);
      Assert.assertEquals("The file size from the statistics is wrong.", FAKE_SIZE, latest.getTotalInputSize());
     
      // insert fake stats with the correct modification time. the call should return the fake stats
      format = new DummyFileInputFormat();
      format.setFilePath(tempDir);
      format.configure(new Configuration());
     
      FileBaseStatistics outDatedFakeStats = new FileBaseStatistics(stats.getLastModificationTime()-1, FAKE_SIZE, BaseStatistics.AVG_RECORD_BYTES_UNKNOWN);
      BaseStatistics reGathered = format.getStatistics(outDatedFakeStats);
      Assert.assertEquals("The file size from the statistics is wrong.", TOTAL, reGathered.getTotalInputSize());
     
    } catch (Exception ex) {
      ex.printStackTrace();
View Full Code Here

TOP

Related Classes of eu.stratosphere.api.common.io.FileInputFormat.FileBaseStatistics

Copyright © 2018 www.massapicom. 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.