Examples of ReplicationWriter


Examples of org.openstreetmap.osmosis.replication.v0_6.ReplicationWriter

    source.setChangeSink(sequenceServer);

    // Create a replication data writer and receive data from the primary
    // data source (via the sequence server).
    File workingDir1 = dataUtils.newFolder();
    sequenceServer.setChangeSink(new ReplicationWriter(workingDir1));

    // Send sequence through the primary pipeline to ensure the
    // sequence server is running.
    source.sendSequence();

    // Create a HTTP replication data server using the data from the
    // replication writer, and receive sequence number updates from the
    // sequence server.
    ReplicationDataServer dataServer = new ReplicationDataServer(sequenceServer.getPort(), workingDir1, 0);

    // Start the HTTP data server.
    TaskRunner serverRunner = new TaskRunner(dataServer, "data-server");
    serverRunner.start();

    /*
     * The server starts in another thread so we need to wait until it has
     * started. We will wait until the dynamically allocated port is
     * exported via the getPort method which occurs after server startup.
     */
    timerStart = System.currentTimeMillis();
    while (dataServer.getPort() == 0 && (System.currentTimeMillis() - timerStart < 10000)) {
      Thread.sleep(10);
    }
    Assert.assertFalse("Server port was not dynamically allocated.", sequenceServer.getPort() == 0);

    // Create a HTTP replication data client receiving data from the data
    // server.
    ReplicationDataClient dataClient = new ReplicationDataClient(new InetSocketAddress(dataServer.getPort()), "");

    // Create a replication data writer to receiving data from the HTTP data
    // source.
    File workingDir2 = dataUtils.newFolder();
    dataClient.setChangeSink(new ReplicationWriter(workingDir2));

    // Start the HTTP data server and HTTP data client.
    TaskRunner clientRunner = new TaskRunner(dataClient, "data-client");
    clientRunner.start();

View Full Code Here

Examples of org.xmlBlaster.contrib.replication.ReplicationWriter

         this.dbSpecific.cleanup(conn, false);
         log.info("setUp: cleanup done, going to bootstrap now ...");
         boolean doWarn = false;
         boolean force = true;
         this.dbSpecific.bootstrap(conn, doWarn, force);
         this.replicationWriter = new ReplicationWriter();
         this.replicationWriter.init(this.info);
      }
      catch (Exception ex) {
         if (conn != null)
            dbPool.release(conn);
View Full Code Here

Examples of org.xmlBlaster.contrib.replication.ReplicationWriter

         SqlInfoParser parser = new SqlInfoParser();
         parser.init(info);
        
         sql = parser.parse(xml);
        
         ReplicationWriter writer = new ReplicationWriter();
         writer.init(info);
         writer.store(sql);
        
         // verify now,

         conn = pool.reserve();
         Statement st = conn.createStatement();
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.