Package org.apache.hadoop.io

Examples of org.apache.hadoop.io.LongWritable


    @Test
    public void rejectTypeTypeInstanceOutsideFreebase() throws IOException,
    InterruptedException {
        String ordinaryTriple = "ns:aviation.aircraft.first_flight\tns:type.type.instance\towl:Thing.";
        mapper.map(new LongWritable(1L), new Text(ordinaryTriple), context);
        verify(context).getCounter(FreebasePrefilterCounter.IGNORED);
        verifyNoMoreInteractions(context);
    }
View Full Code Here


    @Test
    public void ignoreTypeTypeExpectedBy() throws IOException,
    InterruptedException {
        String ordinaryTriple = "ns:aviation.aircraft.first_flight\tns:type.type.expected_by\towl:Thing.";
        mapper.map(new LongWritable(1L), new Text(ordinaryTriple), context);
        verify(context).getCounter(FreebasePrefilterCounter.IGNORED);
        verifyNoMoreInteractions(context);
    }
View Full Code Here

   
    @Test
    public void ignoreNotableForDisplayNames() throws IOException,
    InterruptedException {
        String ordinaryTriple = "ns:rock.me.amadeus\tns:common.notable_for.display_name\t\"Musikale Tracke\"@en";
        mapper.map(new LongWritable(1L), new Text(ordinaryTriple), context);
        verify(context).getCounter(FreebasePrefilterCounter.IGNORED);
        verifyNoMoreInteractions(context);
    }
View Full Code Here

    @Test
    public void usuallyTypeObjectTypeRewritesToA() throws IOException,
    InterruptedException {
        String ordinaryTriple = "ns:aviation.aircraft.first_flight\tns:type.object.type\tns:whatever.";
        mapper.map(new LongWritable(1L), new Text(ordinaryTriple), context);
        verify(context).getCounter(FreebasePrefilterCounter.ACCEPTED);
        verify(context)
        .write(new Text(
                "<http://rdf.basekb.com/ns/aviation.aircraft.first_flight>"),
                new Text(
View Full Code Here

    }

    @Test
    public void weReverseRedirects() throws IOException, InterruptedException {
        String ordinaryTriple = "ns:A\tns:dataworld.gardening_hint.replaced_by\tns:B.";
        mapper.map(new LongWritable(1L), new Text(ordinaryTriple), context);
        verify(context).getCounter(FreebasePrefilterCounter.ACCEPTED);
        verify(context)
        .write(new Text("<http://rdf.basekb.com/ns/B>"),
                new Text(
                        "<http://rdf.basekb.com/ns/m.0j2r8t8>\t<http://rdf.basekb.com/ns/A>."));
View Full Code Here

    }

    @Test
    public void weReversePermissions() throws IOException, InterruptedException {
        String ordinaryTriple = "ns:A\tns:type.permission.controls\tns:B.";
        mapper.map(new LongWritable(1L), new Text(ordinaryTriple), context);
        verify(context).getCounter(FreebasePrefilterCounter.ACCEPTED);
        verify(context)
        .write(new Text("<http://rdf.basekb.com/ns/B>"),
                new Text(
                        "<http://rdf.basekb.com/ns/m.0j2r9sk>\t<http://rdf.basekb.com/ns/A>."));
View Full Code Here

    @Test
    public void testExternalURITriple() throws IOException, InterruptedException {
        Text t=new Text("<http://a.example.com/>\t<http://b.example.com/>\t<http://c.example.com/> .");
        Mapper.Context c=mock(Mapper.Context.class);
        mapper.map(new LongWritable(75),t,c);
        verifyNoMoreInteractions(c);
    }
View Full Code Here

    @Test
    public void testInternalURITriple() throws IOException, InterruptedException {
        Text t=new Text("<http://a.example.com/>\t<http://b.example.com/>\t<http://rdf.basekb.com/ns/f00t> .");
        Mapper.Context c=mock(Mapper.Context.class);
        mapper.map(new LongWritable(75),t,c);
        verify(c).write(new Text("<http://rdf.basekb.com/ns/f00t>"),new LongWritable(1));
        verifyNoMoreInteractions(c);
    }
View Full Code Here

    }
   
    @Test
    public void arnoldSchwarzeneggerAfactIsIgnored() throws IOException, InterruptedException {
        String extraordinaryTriple = "<http://rdf.freebase.com/ns/m.0tc7> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://rdf.freebase.com/ns/film.actor> .";
        mapper.map(new LongWritable(1940L),new Text(extraordinaryTriple), context);
        verify(context).getCounter(FreebasePrefilterCounter.IGNORED);
        verifyNoMoreInteractions(context);
    }
View Full Code Here

    @Test
    public void testLiteralTriple() throws IOException, InterruptedException {
        Text t=new Text("<http://a.example.com/>\t<http://b.example.com/>\t\"even on the darkest night\"@en .");
        Mapper.Context c=mock(Mapper.Context.class);
        mapper.map(new LongWritable(75),t,c);
        verifyNoMoreInteractions(c);
    }
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.