Package org.apache.hadoop.mapreduce.lib.db.DataDrivenDBInputFormat

Examples of org.apache.hadoop.mapreduce.lib.db.DataDrivenDBInputFormat.DataDrivenDBInputSplit


  private void assertSplits(String[] expectedSplitRE,
      List<InputSplit> splits) throws IOException {
    assertEquals(expectedSplitRE.length, splits.size());
    for (int i = 0; i < expectedSplitRE.length; i++) {
      DataDrivenDBInputSplit split = (DataDrivenDBInputSplit) splits.get(i);
      String actualExpr = split.getLowerClause() + " " + split.getUpperClause();
      assertTrue("Split #" + (i+1) + " expression is wrong."
          + " Expected " + expectedSplitRE[i]
          + " Actual " + actualExpr,
          Pattern.matches(expectedSplitRE[i], actualExpr));
    }
View Full Code Here


    when(jobContext.getConfiguration()).thenReturn(configuration);
    DataDrivenDBInputFormat<NullDBWritable> format = new DataDrivenDBInputFormat<NullDBWritable>();
    List<InputSplit> splits = format.getSplits(jobContext);
    assertEquals(1, splits.size());
    DataDrivenDBInputSplit split = (DataDrivenDBInputSplit) splits.get(0);
    assertEquals("1=1", split.getLowerClause());
    assertEquals("1=1", split.getUpperClause());

    // 2
    configuration.setInt(MRJobConfig.NUM_MAPS, 2);

    DataDrivenDBInputFormat.setBoundingQuery(configuration, "query");
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapreduce.lib.db.DataDrivenDBInputFormat.DataDrivenDBInputSplit

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.