This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Test { | |
private static final TestingServer server; | |
private static final CuratorFramework client; | |
static | |
{ | |
TestingServer localServer = null; | |
CuratorFramework localClient = null; | |
try | |
{ | |
localServer = new TestingServer(); |