Package org.apache.jena.tdbloader4

Examples of org.apache.jena.tdbloader4.FourthReducer


        if ( ( copyToLocal ) || ( runLocal ) ) {
          File path = new File(args[1]);
          path.mkdirs();
        }
   
        Tool first = new FirstDriver(configuration);
        int status = first.run(new String[] { args[0], args[1] + OUTPUT_PATH_POSTFIX_1 });
        if (status != 0){ return status ;}

        createOffsetsFile(fs, args[1] + OUTPUT_PATH_POSTFIX_1, args[1] + OUTPUT_PATH_POSTFIX_1);
        Path offsets = new Path(args[1] + OUTPUT_PATH_POSTFIX_1, Constants.OFFSETS_FILENAME);
        DistributedCache.addCacheFile(offsets.toUri(), configuration);
View Full Code Here


        Tool third = new ThirdDriver(configuration);
        status = third.run(new String[] { args[1] + OUTPUT_PATH_POSTFIX_2, args[1] + OUTPUT_PATH_POSTFIX_3 });
        if (status != 0){ return status ;}

        Tool fourth = new FourthDriver(configuration);
        status = fourth.run(new String[] { args[1] + OUTPUT_PATH_POSTFIX_3, args[1] + OUTPUT_PATH_POSTFIX_4 });
        if (status != 0){ return status ;}

        if ( copyToLocal ) {
          Tool download = new download(configuration);
          download.run(new String[] { args[1] + OUTPUT_PATH_POSTFIX_2, args[1] + OUTPUT_PATH_POSTFIX_4, args[1] });
View Full Code Here

            "-D", Constants.OPTION_USE_COMPRESSION + "=" + Constants.OPTION_USE_COMPRESSION_DEFAULT,
            vocabulary,
                input,
                output
        };
        assertEquals ( 0, ToolRunner.run(new InferDriver(), args) );

        // load the output of the MapReduce job
        DatasetGraph dsgMR = load(output + "/part-m-00000");

        // perform inference using RIOT infer
View Full Code Here

        FileSystem fs = FileSystem.get(new Path(args[1]).toUri(), configuration);
        if ( overrideOutput ) {
            fs.delete(new Path(args[1]), true);
        }
   
        Tool infer = new InferDriver(configuration);
        infer.run(new String[] { args[0], args[1] });

    return 0;
  }
View Full Code Here

        createOffsetsFile(fs, args[1] + OUTPUT_PATH_POSTFIX_1, args[1] + OUTPUT_PATH_POSTFIX_1);
        Path offsets = new Path(args[1] + OUTPUT_PATH_POSTFIX_1, Constants.OFFSETS_FILENAME);
        DistributedCache.addCacheFile(offsets.toUri(), configuration);
       
        Tool second = new SecondDriver(configuration);
        status = second.run(new String[] { args[0], args[1] + OUTPUT_PATH_POSTFIX_2 });
        if (status != 0){ return status ;}

        Tool third = new ThirdDriver(configuration);
        status = third.run(new String[] { args[1] + OUTPUT_PATH_POSTFIX_2, args[1] + OUTPUT_PATH_POSTFIX_3 });
        if (status != 0){ return status ;}
View Full Code Here

        FileSystem fs = FileSystem.get(new Path(args[1]).toUri(), configuration);
        if ( overrideOutput ) {
            fs.delete(new Path(args[1]), true);
        }
   
        Tool stats = new StatsDriver(configuration);
        stats.run(new String[] { args[0], args[1] });

    return 0;
  }
View Full Code Here

class TupleSerializationFactory implements SerializationFactory<Tuple<Long>> {

    @Override public Iterator<Tuple<Long>> createDeserializer(InputStream in) { return new TupleInputStream(in, 3); }
    @Override public Sink<Tuple<Long>> createSerializer(OutputStream out) { return new TupleOutputStream(out); }
    @Override public long getEstimatedMemorySize(Tuple<Long> item) { throw new TDBLoader4Exception("Method not implemented.") ; }
View Full Code Here

class TupleComparator implements Comparator<Tuple<Long>> {
    @Override
    public int compare(Tuple<Long> t1, Tuple<Long> t2) {
        int size = t1.size();
        if ( size != t2.size() ) throw new TDBLoader4Exception("Cannot compare tuple of different sizes.") ;
        for ( int i = 0; i < size; i++ ) {
            int result = t1.get(i).compareTo(t2.get(i)) ;
            if ( result != 0 ) {
                return result ;
            }
View Full Code Here

        Iterator<Long> iter = tuple.iterator() ;
        while ( iter.hasNext() ) {
            try {
                out.writeLong( iter.next() ) ;
            } catch (IOException e) {
                new TDBLoader4Exception("Problems writing") ;
            }
        }
    }
View Full Code Here

    @Override
    public void flush() {
        try {
            out.flush() ;
        } catch (IOException e) {
            new TDBLoader4Exception("Problems flushing") ;
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jena.tdbloader4.FourthReducer

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.