Skip to content

Instantly share code, notes, and snippets.

package org.apache.curator.framework.recipes.leader;
import com.google.common.collect.Lists;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.retry.RetryOneTime;
import org.apache.curator.test.InstanceSpec;
import org.apache.curator.test.TestingCluster;
import java.util.List;
public static void main(String[] args) throws Exception
{
TestingServer server = new TestingServer();
final CountDownLatch latch = new CountDownLatch(1);
Watcher watcher = new Watcher()
{
@Override
public void process(WatchedEvent event)
{
public static void main(String[] args) throws Exception
{
TestingServer server = new TestingServer();
final CountDownLatch latch = new CountDownLatch(1);
Watcher watcher = new Watcher()
{
@Override
public void process(WatchedEvent event)
{
@Test
public void testTimedAcquire() throws Exception
{
final int MAX_WAIT_MS = 10000;
final int SLEEP_MS = 1000;
CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
client.start();
try
{
<?xml version="1.0" encoding="UTF-8"?>
<testrun duration="25286" footerText="Generated by IntelliJ IDEA on 7/23/14 11:53 PM" name="TestTreeCache">
<count name="total" value="15"/>
<count name="failed" value="6"/>
<count name="passed" value="9"/>
<suite duration="25286" status="failed" name="org.apache.curator.framework.recipes.cache">
<suite duration="25286" status="failed" name="TestTreeCache">
<test duration="3336" status="passed" name="testAsyncInitialPopulation"/>
<test duration="2042" status="passed" name="testBasics"/>
<test duration="2018" status="passed" name="testBasicsOnTwoCaches"/>
public static void main(String[] args) throws Exception
{
System.setProperty(DebugUtils.PROPERTY_LOG_EVENTS, "true");
TestingServer server = new TestingServer();
final int QTY = 3000;
final String PATH = "/bjn/z1/denim/mediaCapacity";
final String FILE = "4006046.";
Timing timing = new Timing();
Process: Airmail [1126]
Path: /Applications/Airmail.app/Contents/MacOS/Airmail
Identifier: it.bloop.airmail
Version: 1.4 (247)
App Item ID: 573171375
App External ID: 546902650
Code Type: X86-64 (Native)
Parent Process: launchd [270]
Responsible: Airmail [1126]
User ID: 501
#!/usr/bin/env bash
QUBOLE_APP_HOME=$(pwd)
QUBOLE_APP_CONF=$QUBOLE_APP_HOME/config
QUBOLE_APP_LIB=$QUBOLE_APP_HOME/lib
# calculate_heap_size() and default DEFAULT_JVM_OPTS loosely based
# on Cassandra startup script
calculate_heap_size()
BACKGROUND
============
A recurring problem for ZooKeeper users is garbage collection of parent nodes. Many recipes
(e.g. locks, leaders, etc.) call for the creation of a parent node under which participants
create sequential nodes. When the participant is done, it deletes its node. In practice, the
ZooKeeper tree begins to fill up with orphaned parent nodes that are no longer needed. The
ZooKeeper APIs don’t provide a way to clean these. Over time, ZooKeeper can become unstable
due to the number of these nodes.
CURRENT SOLUTIONS
public class Test {
private static final TestingServer server;
private static final CuratorFramework client;
static
{
TestingServer localServer = null;
CuratorFramework localClient = null;
try
{
localServer = new TestingServer();