Package org.apache.hadoop.io

Examples of org.apache.hadoop.io.LongWritable


    }
   
    @Test
    public void arnoldSchwarzeneggerIsAFilmActor() throws IOException, InterruptedException {
        pse3mapper.map(
                new LongWritable(944L),
                new Text("<http://rdf.basekb.com/ns/m.0tc7> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>\t<http://rdf.basekb.com/ns/film.actor>."),
                mockContext);
       
        verify(pse3mapper.accepted).write(
                new WritableTriple(
View Full Code Here


    }
   
    @Test
    public void acceptsARealFreebaseTripleWithSpaces() throws IOException,InterruptedException {
        pse3mapper.map(
                new LongWritable(944L),
                new Text("<http://rdf.basekb.com/ns/m.06fm3lj> <http://rdf.basekb.com/ns/book.written_work.author> <http://rdf.basekb.com/ns/m.03qp7yf>."),
                mockContext);

        verify(pse3mapper.accepted).write(
                new WritableTriple(
View Full Code Here

    }
   
    @Test
    public void rejects$Escapes() throws IOException,InterruptedException {
        pse3mapper.map(
                new LongWritable(944L),
                new Text("<http://rdf.basekb.com/ns/m.0tc7> <http://rdf.basekb.com/ns/common.topic.topic_equivalent_webpage> <http://www.ranker.com/review/arnold-schwarzenegger$002F493404> ."),
                mockContext);

        verify(pse3mapper.accepted).write(
                new WritableTriple(
View Full Code Here

    }

    @Test
    public void rejectsABadTriple() throws IOException, InterruptedException {
        pse3mapper.map(
                new LongWritable(24562L),
                new Text("<http://example.com/A>\t<http://example.com/B>\t\"2001-06\"^^xsd:datetime."),
                mockContext);

        verifyNoMoreInteractions(pse3mapper.accepted);
    }
View Full Code Here

    }

    @Test
    public void rejectsOther() throws IOException, InterruptedException {
        mapper.map(
                new LongWritable(999),
                new Text("<http://a.b.c/>\t<http://rdf.basekb.com/ns/type.object.key>\t\"/wikipedia/en_id/136701\"\t."),
                context
        );
        verifyNoMoreInteractions(context);
    }
View Full Code Here

    }

    @Test
    public void moonPrismPower() throws IOException, InterruptedException {
        mapper.map(
                new LongWritable(999),
                new Text("<http://a.b.c/>\t<http://rdf.basekb.com/ns/type.object.key>\t\"/wikipedia/en_title/Sailor_Moon\"\t."),
                context
        );

        verify(context).write(
View Full Code Here

    }

    @Test
    public void tryOne() throws IOException, InterruptedException {
        Text triple=new Text("<http://example.com/>\t<http://rdf.basekb.com/public/subjectiveEye3D>\t\"3.14159\"^^xsd:float\t.");
        mapper.map(new LongWritable(99),triple,context);
        verify(context).write(new Text("<http://example.com/>"),new FloatWritable(3.14159F));
    }
View Full Code Here

    }

    @Test
    public void rejectsOtherPredicate() throws IOException, InterruptedException {
        Text triple=new Text("<http://example.com/>\t<http://rdf.basekb.com/public/subjectiveEye4D>\t\"3.14159\"^^xsd:float\t.");
        mapper.map(new LongWritable(99),triple,context);
        verifyNoMoreInteractions(context);
    }
View Full Code Here

    @Test
    public void processItemFromObjectList() throws IOException, InterruptedException {
        stubPath("s3n://basekb-sandbox/2013-11-10/uniqSubjects/m-32194.gz");
        that.setup(setupContext);
        that.map(
                new LongWritable(1)
                , new Text("<http://rdf.example.com/DOOM>")
                , mapContext);
        verify(mapContext).write(
            argThat(new TaggedItemMatcher<Text>(new TaggedTextItem("<http://rdf.example.com/DOOM>", 1))),
            argThat(new TaggedItemMatcher<Text>(new TaggedTextItem("", 1)))
View Full Code Here

    public void processItemFromFactList() throws IOException, InterruptedException {
        stubPath("s3n://basekb-now/2013-11-10/sieved/links/m-23456.gz");
        that.setup(setupContext);
        String fact="<http://rdf.example.com/A> <http://rdf.example.com/B> <http://rdf.example.com/C> .";
        that.map(
                new LongWritable(1)
                , new Text(fact)
                , mapContext);
        verify(mapContext).write(
                argThat(new TaggedItemMatcher<Text>(new TaggedTextItem("<http://rdf.example.com/C>", 2))),
                argThat(new TaggedItemMatcher<Text>(new TaggedTextItem(fact, 2)))
View Full Code Here

TOP

Related Classes of org.apache.hadoop.io.LongWritable

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.