Package org.apache.zookeeper.KeeperException

Examples of org.apache.zookeeper.KeeperException.ConnectionLossException


    assertEquals(RV, rv);
  }

  @Test
  public void testInvokeRetrySuccessful() throws Throwable {
    ConnectionLossException e = createMock(ConnectionLossException.class);
    expect(zrw.putEphemeralData(eq(PATH), aryEq(DATA))).andThrow(e);
    expect(zrw.putEphemeralData(eq(PATH), aryEq(DATA))).andThrow(e);
    expect(zrw.putEphemeralData(eq(PATH), aryEq(DATA))).andReturn(RV);
    replay(zrw);
    Object rv = ih.invoke(null, putMethod, ARGS);
View Full Code Here


    assertEquals(RV, rv);
  }

  @Test(expected = InterruptedException.class)
  public void testInvokeRetryFailure() throws Throwable {
    ConnectionLossException e = createMock(ConnectionLossException.class);
    expect(zrw.putEphemeralData(eq(PATH), aryEq(DATA))).andThrow(e);
    expect(zrw.putEphemeralData(eq(PATH), aryEq(DATA))).andThrow(new InterruptedException());
    replay(zrw);
    try {
      ih.invoke(null, putMethod, ARGS);
View Full Code Here

            try {
                setupNodes(zk);
                break;
            } catch(ConnectionLossException e) {}
        }
        ConnectionLossException lastException = null;
        for(int i = 0; i < maxTries; i++) {
            try {
                List<String> children = zk.getChildren(statusNode, this);
                processResult(0, statusNode, null, children);
                lastException = null;
View Full Code Here

            try {
                setupNodes(zk);
                break;
            } catch(ConnectionLossException e) {}
        }
        ConnectionLossException lastException = null;
        for(int i = 0; i < maxTries; i++) {
            try {
                List<String> children = zk.getChildren(statusNode, this);
                processResult(0, statusNode, null, children);
                lastException = null;
View Full Code Here

            try {
                setupNodes(zk);
                break;
            } catch(ConnectionLossException e) {}
        }
        ConnectionLossException lastException = null;
        for(int i = 0; i < maxTries; i++) {
            try {
                List<String> children = zk.getChildren(statusNode, this);
                processResult(0, statusNode, null, children);
                lastException = null;
View Full Code Here

  @Test
  public void testZooKeeperErrorDoesntLoseItemsReally() throws Exception {
    final ZooKeeperClient mockClient = mock(ZooKeeperClient.class);
    makeWriter(mockClient);
    final String path = Paths.historyJobHostEventsTimestamp(JOB_ID, HOSTNAME, TIMESTAMP);
    final KeeperException exc = new ConnectionLossException();
    // make save operations fail
    doThrow(exc).when(mockClient).createAndSetData(path, TASK_STATUS.toJsonBytes());

    writer.saveHistoryItem(JOB_ID, TASK_STATUS, TIMESTAMP);
    // wait up to 10s for it to fail twice -- and make sure I mocked it correctly.
View Full Code Here

            try {
                setupNodes(zk);
                break;
            } catch(ConnectionLossException e) {}
        }
        ConnectionLossException lastException = null;
        for(int i = 0; i < maxTries; i++) {
            try {
                List<String> children = zk.getChildren(statusNode, this);
                processResult(0, statusNode, null, children);
                lastException = null;
View Full Code Here

TOP

Related Classes of org.apache.zookeeper.KeeperException.ConnectionLossException

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.