Package org.apache.tajo.worker.dataserver

Examples of org.apache.tajo.worker.dataserver.HttpDataServer


    }
    writer.flush();
    writer.close();

    DataRetriever ret = new DirectoryRetriever(INPUT_DIR);
    HttpDataServer server = new HttpDataServer(
        NetUtils.createSocketAddr("127.0.0.1:0"), ret);
    server.start();
    InetSocketAddress addr = server.getBindAddress();
   
    URI uri = URI.create("http://127.0.0.1:"+addr.getPort() + "/data");
    Fetcher fetcher = new Fetcher(uri, new File(OUTPUT_DIR + "data"));
    fetcher.get();
    server.stop();
   
    FileSystem fs = FileSystem.getLocal(new TajoConf());
    FileStatus inStatus = fs.getFileStatus(new Path(INPUT_DIR, "data"));
    FileStatus outStatus = fs.getFileStatus(new Path(OUTPUT_DIR, "data"));
    assertEquals(inStatus.getLen(), outStatus.getLen());
View Full Code Here


    }
    writer.flush();
    writer.close();

    DataRetriever ret = new DirectoryRetriever(INPUT_DIR);
    HttpDataServer server = new HttpDataServer(
        NetUtils.createSocketAddr("127.0.0.1:0"), ret);
    server.start();
    InetSocketAddress addr = server.getBindAddress();
   
    URI uri = URI.create("http://127.0.0.1:"+addr.getPort() + "/data");
    ClientSocketChannelFactory channelFactory = RpcChannelFactory.createClientChannelFactory("Fetcher", 1);
    Fetcher fetcher = new Fetcher(uri, new File(OUTPUT_DIR + "data"), channelFactory);
    fetcher.get();
    server.stop();
   
    FileSystem fs = FileSystem.getLocal(new TajoConf());
    FileStatus inStatus = fs.getFileStatus(new Path(INPUT_DIR, "data"));
    FileStatus outStatus = fs.getFileStatus(new Path(OUTPUT_DIR, "data"));
    assertEquals(inStatus.getLen(), outStatus.getLen());
View Full Code Here

TOP

Related Classes of org.apache.tajo.worker.dataserver.HttpDataServer

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.