Examples of nextKeyValue()


Examples of org.apache.hadoop.vertica.VerticaRecordReader.nextKeyValue()

        .getConfiguration());
    TaskAttemptContext context = new TaskAttemptContextImpl(input
        .getConfiguration(), new TaskAttemptID());
    reader.initialize(input, context);

    boolean hasValue = reader.nextKeyValue();
    assertEquals("There should be a record in the database", hasValue, true);
   
    LongWritable key = reader.getCurrentKey();
    VerticaRecord value = reader.getCurrentValue();
View Full Code Here

Examples of org.apache.mahout.classifier.df.mapreduce.inmem.InMemInputFormat.InMemRecordReader.nextKeyValue()

        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

Examples of org.apache.mahout.df.mapreduce.inmem.InMemInputFormat.InMemRecordReader.nextKeyValue()

        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

Examples of org.apache.mahout.ga.watchmaker.cd.hadoop.DatasetSplit.RndLineRecordReader.nextKeyValue()

      // read the training set
      split.storeJobParameters(conf);
      long datasetSize = 100;
      RndLineRecordReader rndReader = new RndLineRecordReader(new MockReader(datasetSize), conf);
      while (rndReader.nextKeyValue()) {
        assertTrue("duplicate line index", dataset.add(rndReader.getCurrentKey().get()));
      }

      // read the testing set
      split.setTraining(false);
View Full Code Here

Examples of org.apache.mahout.ga.watchmaker.cd.hadoop.DatasetSplit.RndLineRecordReader.nextKeyValue()

      // read the testing set
      split.setTraining(false);
      split.storeJobParameters(conf);
      rndReader = new RndLineRecordReader(new MockReader(datasetSize), conf);
      while (rndReader.nextKeyValue()) {
        assertTrue("duplicate line index", dataset.add(rndReader.getCurrentKey().get()));
      }

      assertEquals("missing datas", datasetSize, dataset.size());
    }
View Full Code Here

Examples of org.apache.pig.impl.io.InterRecordReader.nextKeyValue()

        InterRecordReader reader = new InterRecordReader();
        reader.initialize(is, HadoopShims.createTaskAttemptContext(conf, taskId));

        for (int i = 0; i < sz; i++) {
            assertTrue(reader.nextKeyValue());
            SchemaTuple<?> st = (SchemaTuple<?>)reader.getCurrentValue();
            assertEquals(written.get(i), st);
        }
        reader.close();
View Full Code Here

Examples of org.apache.pig.impl.io.TFileRecordReader.nextKeyValue()

                        conf,
                        HadoopShims.createTaskAttemptID("jt", 1, true, 1, 1)));

                float progress = 0,  lastprogress = 0;
                int curval = 0, prevval = -1;
                while (reader.nextKeyValue()) {
                    Tuple t = (Tuple) reader.getCurrentValue();
                    curval = Integer.valueOf((String) t.get(0));
                    assertEquals("Unexpected Value", curval, prevval + 1);
                    prevval = curval;
View Full Code Here

Examples of pignlproc.format.WikipediaPageInputFormat.WikipediaRecordReader.nextKeyValue()

        assertNotNull(wikiDump);
        WikipediaRecordReader reader = new WikipediaPageInputFormat.WikipediaRecordReader(
                wikiDump, 0, 100000);

        // first article
        assertTrue(reader.nextKeyValue());
        assertEquals(new Text("AccessibleComputing"), reader.getCurrentKey());
        String markup = reader.getCurrentValue().toString();
        assertEquals(
                "#REDIRECT [[Computer accessibility]] {{R from CamelCase}}",
                markup);
View Full Code Here

Examples of pignlproc.format.WikipediaPageInputFormat.WikipediaRecordReader.nextKeyValue()

        assertTrue(converter.getWikiLinkAnnotations().isEmpty());
        assertEquals("http://en.wikipedia.org/wiki/Computer_accessibility",
                converter.getRedirect());

        // second article
        assertTrue(reader.nextKeyValue());
        assertEquals("Anarchism", reader.getCurrentKey().toString());
        markup = reader.getCurrentValue().toString();
        converter = new AnnotatingMarkupParser();
        simpleText = converter.parse(markup);
        assertTrue(simpleText.startsWith("\nAnarchism is a political philosophy"
View Full Code Here

Examples of pignlproc.format.WikipediaPageInputFormat.WikipediaRecordReader.nextKeyValue()

        assertEquals(36, firstLink.end);
        assertEquals("political philosophy",
                simpleText.substring(firstLink.begin, firstLink.end));

        // third article
        assertTrue(reader.nextKeyValue());
        assertEquals("AfghanistanHistory", reader.getCurrentKey().toString());
        markup = reader.getCurrentValue().toString();
        converter = new AnnotatingMarkupParser();
        simpleText = converter.parse(markup);
        assertEquals("", simpleText);
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.