Package org.apache.zookeeper.server

Examples of org.apache.zookeeper.server.ZooKeeperServer.shutdown()


            Assert.assertTrue("excepting next transaction. expected=" + expectedZxid + ", retreived=" + hdr.getZxid(), (hdr.getZxid() == expectedZxid));
            lastZxid = hdr.getZxid();
        }while(itr.next());
 
        Assert.assertTrue("processed all transactions. " + expectedZxid + " == " + TOTAL_TRANSACTIONS, (expectedZxid == TOTAL_TRANSACTIONS));
        zks.shutdown();
    }



View Full Code Here


        zks.getZKDatabase().getDataTreeLastProcessedZxid() - 10);
    LOG.info("Set lastProcessedZxid to "
        + zks.getZKDatabase().getDataTreeLastProcessedZxid());
    // Force snapshot and restore
    zks.takeSnapshot();
    zks.shutdown();
    f.shutdown();

    zks = new ZooKeeperServer(tmpDir, tmpDir, 3000);
    SyncRequestProcessor.setSnapCount(10000);
    f = ServerCnxnFactory.createFactory(PORT, -1);
View Full Code Here

        + expectedPath + " found " + path, path.equals(expectedPath));
    Assert.assertTrue("Unexpected number of children " + children.length
        + " expected " + NUM_MESSAGES,
        (children.length == NUM_MESSAGES));
    f.shutdown();
                zks.shutdown();
  }
   
    /**
     * Test we can restore a snapshot that has errors and data ahead of the zxid
     * of the snapshot file.
View Full Code Here

        LOG.info("Set lastProcessedZxid to "
                + zks.getZKDatabase().getDataTreeLastProcessedZxid());
       
        // Force snapshot and restore
        zks.takeSnapshot();
        zks.shutdown();
        f.shutdown();

        zks = new ZooKeeperServer(tmpDir, tmpDir, 3000);
        SyncRequestProcessor.setSnapCount(10000);
        f = ServerCnxnFactory.createFactory(PORT, -1);
View Full Code Here

        f.startup(zks);
        Assert.assertTrue("waiting for server being up ", ClientBase
                .waitForServerUp(HOSTPORT, CONNECTION_TIMEOUT));
       
        f.shutdown();
        zks.shutdown();
    }

    /**
     * ZOOKEEPER-1573: test restoring a snapshot with deleted txns ahead of the
     * snapshot file's zxid.
View Full Code Here

        zks.getZKDatabase().setlastProcessedZxid(createZxId);
        LOG.info("Set lastProcessedZxid to {}", zks.getZKDatabase()
                .getDataTreeLastProcessedZxid());
        // Force snapshot and restore
        zks.takeSnapshot();
        zks.shutdown();
        f.shutdown();

        zks = new ZooKeeperServer(tmpDir, tmpDir, 3000);
        SyncRequestProcessor.setSnapCount(10000);
        f = ServerCnxnFactory.createFactory(PORT, -1);
View Full Code Here

                    }
                }
            }

            f.shutdown();
            zks.shutdown();
            Assert.assertTrue("waiting for server down",
                       ClientBase.waitForServerDown(HOSTPORT,
                                          CONNECTION_TIMEOUT));

            zks = new ZooKeeperServer(tmpDir, tmpDir, 3000);
View Full Code Here

                                stat)), subsubpath + "!");
                    }
                }
            }
            f.shutdown();
            zks.shutdown();

            Assert.assertTrue("waiting for server down",
                       ClientBase.waitForServerDown(HOSTPORT,
                                          ClientBase.CONNECTION_TIMEOUT));
View Full Code Here

                }
            }
            zk.close();

            f.shutdown();
            zks.shutdown();

            Assert.assertTrue("waiting for server down",
                       ClientBase.waitForServerDown(HOSTPORT,
                                                    CONNECTION_TIMEOUT));
        } finally {
View Full Code Here

            }
        } finally {
            zk.close();
        }
        f.shutdown();
        zks.shutdown();
        Assert.assertTrue("waiting for server to shutdown",
                ClientBase.waitForServerDown(HOSTPORT, CONNECTION_TIMEOUT));

        // start server again
        zks = new ZooKeeperServer(tmpDir, tmpDir, 3000);
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.