Examples of CuratorTransactionResult


Examples of org.apache.curator.framework.api.transaction.CuratorTransactionResult

            Assert.assertTrue(client.checkExists().forPath("/foo") != null);
            Assert.assertTrue(client.usingNamespace(null).checkExists().forPath("/galt/foo") != null);
            Assert.assertEquals(client.getData().forPath("/foo"), "two".getBytes());
            Assert.assertTrue(client.checkExists().forPath("/foo/bar") == null);

            CuratorTransactionResult    ephemeralResult = Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/test-"));
            Assert.assertNotNull(ephemeralResult);
            Assert.assertNotEquals(ephemeralResult.getResultPath(), "/test-");
            Assert.assertTrue(ephemeralResult.getResultPath().startsWith("/test-"));
        }
        finally
        {
            client.close();
        }
View Full Code Here

Examples of org.apache.curator.framework.api.transaction.CuratorTransactionResult

                    .commit();

            Assert.assertTrue(client.checkExists().forPath("/foo/bar") != null);
            Assert.assertEquals(client.getData().forPath("/foo/bar"), "snafu".getBytes());

            CuratorTransactionResult    fooResult = Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/foo"));
            CuratorTransactionResult    fooBarResult = Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/foo/bar"));
            Assert.assertNotNull(fooResult);
            Assert.assertNotNull(fooBarResult);
            Assert.assertNotSame(fooResult, fooBarResult);
            Assert.assertEquals(fooResult.getResultPath(), "/foo");
            Assert.assertEquals(fooBarResult.getResultPath(), "/foo/bar");
        }
        finally
        {
            client.close();
        }
View Full Code Here

Examples of org.apache.curator.framework.api.transaction.CuratorTransactionResult

        ImmutableList.Builder<CuratorTransactionResult>     builder = ImmutableList.builder();
        for ( int i = 0; i < resultList.size(); ++i )
        {
            OpResult                                    opResult = resultList.get(i);
            CuratorMultiTransactionRecord.TypeAndPath   metadata = transaction.getMetadata(i);
            CuratorTransactionResult                    curatorResult = makeCuratorResult(opResult, metadata);
            builder.add(curatorResult);
        }

        return builder.build();
    }
View Full Code Here

Examples of org.apache.curator.framework.api.transaction.CuratorTransactionResult

                resultStat = setDataResult.getStat();
                break;
            }
        }

        return new CuratorTransactionResult(metadata.type, metadata.forPath, resultPath, resultStat);
    }
View Full Code Here

Examples of org.apache.curator.framework.api.transaction.CuratorTransactionResult

            Assert.assertTrue(client.checkExists().forPath("/foo") != null);
            Assert.assertTrue(client.nonNamespaceView().checkExists().forPath("/galt/foo") != null);
            Assert.assertEquals(client.getData().forPath("/foo"), "two".getBytes());
            Assert.assertTrue(client.checkExists().forPath("/foo/bar") == null);

            CuratorTransactionResult    ephemeralResult = Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/test-"));
            Assert.assertNotNull(ephemeralResult);
            Assert.assertNotEquals(ephemeralResult.getResultPath(), "/test-");
            Assert.assertTrue(ephemeralResult.getResultPath().startsWith("/test-"));
        }
        finally
        {
            client.close();
        }
View Full Code Here

Examples of org.apache.curator.framework.api.transaction.CuratorTransactionResult

                    .commit();

            Assert.assertTrue(client.checkExists().forPath("/foo/bar") != null);
            Assert.assertEquals(client.getData().forPath("/foo/bar"), "snafu".getBytes());

            CuratorTransactionResult    fooResult = Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/foo"));
            CuratorTransactionResult    fooBarResult = Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/foo/bar"));
            Assert.assertNotNull(fooResult);
            Assert.assertNotNull(fooBarResult);
            Assert.assertNotSame(fooResult, fooBarResult);
            Assert.assertEquals(fooResult.getResultPath(), "/foo");
            Assert.assertEquals(fooBarResult.getResultPath(), "/foo/bar");
        }
        finally
        {
            client.close();
        }
View Full Code Here

Examples of org.apache.curator.framework.api.transaction.CuratorTransactionResult

            Assert.assertTrue(client.checkExists().forPath("/foo") != null);
            Assert.assertTrue(client.nonNamespaceView().checkExists().forPath("/galt/foo") != null);
            Assert.assertEquals(client.getData().forPath("/foo"), "two".getBytes());
            Assert.assertTrue(client.checkExists().forPath("/foo/bar") == null);

            CuratorTransactionResult    ephemeralResult = Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/test-"));
            Assert.assertNotNull(ephemeralResult);
            Assert.assertNotEquals(ephemeralResult.getResultPath(), "/test-");
            Assert.assertTrue(ephemeralResult.getResultPath().startsWith("/test-"));
        }
        finally
        {
            client.close();
        }
View Full Code Here

Examples of org.apache.curator.framework.api.transaction.CuratorTransactionResult

                    .commit();

            Assert.assertTrue(client.checkExists().forPath("/foo/bar") != null);
            Assert.assertEquals(client.getData().forPath("/foo/bar"), "snafu".getBytes());

            CuratorTransactionResult    fooResult = Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/foo"));
            CuratorTransactionResult    fooBarResult = Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/foo/bar"));
            Assert.assertNotNull(fooResult);
            Assert.assertNotNull(fooBarResult);
            Assert.assertNotSame(fooResult, fooBarResult);
            Assert.assertEquals(fooResult.getResultPath(), "/foo");
            Assert.assertEquals(fooBarResult.getResultPath(), "/foo/bar");
        }
        finally
        {
            client.close();
        }
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.