Package org.apache.mahout.df.mapreduce.inmem.InMemInputFormat

Examples of org.apache.mahout.df.mapreduce.inmem.InMemInputFormat.InMemInputSplit


   * Make sure that all the fields are processed correctly
   * @throws IOException
   *
   */
  public void testWritable() throws IOException {
    InMemInputSplit split = new InMemInputSplit(rng.nextInt(), rng.nextInt(1000), rng.nextLong());
   
    split.write(out);
    assertEquals(split, readSplit());
  }
View Full Code Here


   * test the case seed == null
   * @throws IOException
   *
   */
  public void testNullSeed() throws IOException {
    InMemInputSplit split = new InMemInputSplit(rng.nextInt(), rng.nextInt(1000), null);
   
    split.write(out);
    assertEquals(split, readSplit());
  }
View Full Code Here

      int expectedId = 0;

      for (int index = 0; index < numSplits; index++) {
        assertTrue(splits.get(index) instanceof InMemInputSplit);
       
        InMemInputSplit split = (InMemInputSplit) splits.get(index);

        assertEquals(expectedId, split.getFirstId());

        if (index < numSplits - 1)
          assertEquals(nbTreesPerSplit, split.getNbTrees());
        else
          assertEquals(nbTrees - totalTrees, split.getNbTrees());

        totalTrees += split.getNbTrees();
        expectedId += split.getNbTrees();
      }
    }
  }
View Full Code Here

      InMemInputFormat inputFormat = new InMemInputFormat();
      List<InputSplit> splits = inputFormat.getSplits(conf, numSplits);

      for (int index = 0; index < numSplits; index++) {
        InMemInputSplit split = (InMemInputSplit) splits.get(index);
        InMemRecordReader reader = new InMemRecordReader(split);

        reader.initialize(split, null);
       
        for (int tree = 0; tree < split.getNbTrees(); tree++) {
          // reader.next() should return true until there is no tree left
          assertEquals(tree < split.getNbTrees(), reader.nextKeyValue());
          assertEquals(split.getFirstId() + tree, reader.getCurrentKey().get());
        }
      }
    }
  }
View Full Code Here

  /**
   * Make sure that all the fields are processed correctly
   */
  @Test
  public void testWritable() throws Exception {
    InMemInputSplit split = new InMemInputSplit(rng.nextInt(), rng.nextInt(1000), rng.nextLong());
   
    split.write(out);
    assertEquals(split, readSplit());
  }
View Full Code Here

  /**
   * test the case seed == null
   */
  @Test
  public void testNullSeed() throws Exception {
    InMemInputSplit split = new InMemInputSplit(rng.nextInt(), rng.nextInt(1000), null);
   
    split.write(out);
    assertEquals(split, readSplit());
  }
View Full Code Here

      int expectedId = 0;

      for (int index = 0; index < numSplits; index++) {
        assertTrue(splits.get(index) instanceof InMemInputSplit);
       
        InMemInputSplit split = (InMemInputSplit) splits.get(index);

        assertEquals(expectedId, split.getFirstId());

        if (index < numSplits - 1) {
          assertEquals(nbTreesPerSplit, split.getNbTrees());
        } else {
          assertEquals(nbTrees - totalTrees, split.getNbTrees());
        }

        totalTrees += split.getNbTrees();
        expectedId += split.getNbTrees();
      }
    }
  }
View Full Code Here

      InMemInputFormat inputFormat = new InMemInputFormat();
      List<InputSplit> splits = inputFormat.getSplits(conf, numSplits);

      for (int index = 0; index < numSplits; index++) {
        InMemInputSplit split = (InMemInputSplit) splits.get(index);
        InMemRecordReader reader = new InMemRecordReader(split);

        reader.initialize(split, null);
       
        for (int tree = 0; tree < split.getNbTrees(); tree++) {
          // reader.next() should return true until there is no tree left
          assertEquals(tree < split.getNbTrees(), reader.nextKeyValue());
          assertEquals(split.getFirstId() + tree, reader.getCurrentKey().get());
        }
      }
    }
  }
View Full Code Here

   * Make sure that all the fields are processed correctly
   * @throws IOException
   *
   */
  public void testWritable() throws IOException {
    InMemInputSplit split = new InMemInputSplit(rng.nextInt(), rng.nextInt(1000), rng.nextLong());
   
    split.write(out);
    assertEquals(split, readSplit());
  }
View Full Code Here

   * test the case seed == null
   * @throws IOException
   *
   */
  public void testNullSeed() throws IOException {
    InMemInputSplit split = new InMemInputSplit(rng.nextInt(), rng.nextInt(1000), null);
   
    split.write(out);
    assertEquals(split, readSplit());
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.df.mapreduce.inmem.InMemInputFormat.InMemInputSplit

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.