Package com.netflix.astyanax.connectionpool

Examples of com.netflix.astyanax.connectionpool.Host


       
        ConnectionPool<TestClient> pool = new BagOfConnectionsConnectionPoolImpl<TestClient>(
                config, new TestConnectionFactory(config, monitor), monitor);

        pool.addHost(new Host("127.0.0.1",
                TestHostType.CONNECT_WITH_UNCHECKED_EXCEPTION.ordinal()), true);

        OperationResult<String> result;

        try {
View Full Code Here


        ConnectionPool<TestClient> pool = new BagOfConnectionsConnectionPoolImpl<TestClient>(
                config, new TestConnectionFactory(config, monitor), monitor);

        pool.addHost(
                new Host("127.0.0.1", TestHostType.OPERATION_TIMEOUT.ordinal()),
                true);
        pool.addHost(
                new Host("127.0.0.2", TestHostType.OPERATION_TIMEOUT.ordinal()),
                true);

        for (int i = 0; i < 5; i++) {
            OperationResult<String> result;
View Full Code Here

    public void testAll() {
        ConnectionPool<TestClient> pool = createPool();

        for (int i = 0; i < 5; i++) {
            pool.addHost(
                    new Host("127.0." + i + ".0", TestHostType.GOOD_FAST
                            .ordinal()), true);
            // pool.addHost(new Host("127.0." + i + ".1",
            // MockHostType.LOST_CONNECTION.ordinal()));
            // pool.addHost(new Host("127.0." + i + ".1",
            // MockHostType.CONNECT_TIMEOUT.ordinal()));
View Full Code Here

    public void testRollingRestart() {
        ConnectionPool<TestClient> pool = createPool();

        List<Host> hosts = new ArrayList<Host>();
        for (int i = 0; i < 5; i++) {
            Host host = new Host("127.0." + i + ".0",
                    TestHostType.GOOD_FAST.ordinal());
            pool.addHost(host, true);
            hosts.add(host);
        }
View Full Code Here

    @Test
    public void testAlwaysDown() {
        ConnectionPool<TestClient> pool = createPool();

        pool.addHost(new Host("127.0.0.1", TestHostType.ALWAYS_DOWN.ordinal()),
                true);

        try {
            pool.executeWithFailover(dummyOperation, RunOnce.get());
            Assert.fail();
View Full Code Here

    @Test
    public void testConnectTimeout() {
        ConnectionPool<TestClient> pool = createPool();

        pool.addHost(
                new Host("127.0.0.1", TestHostType.CONNECT_TIMEOUT.ordinal()),
                true);

        try {
            pool.executeWithFailover(dummyOperation, RunOnce.get());
            Assert.fail();
View Full Code Here

    @Test
    public void testOperationTimeoutTimeout() {
        ConnectionPool<TestClient> pool = createPool();

        pool.addHost(
                new Host("127.0.0.1", TestHostType.OPERATION_TIMEOUT.ordinal()),
                true);

        try {
            pool.executeWithFailover(dummyOperation, RunOnce.get());
            Assert.fail();
View Full Code Here

    @Test
    public void testTimeoutTimeout() {
        ConnectionPool<TestClient> pool = createPool();

        pool.addHost(
                new Host("127.0.0.1", TestHostType.SOCKET_TIMEOUT.ordinal()),
                true);

        try {
            pool.executeWithFailover(dummyOperation, RunOnce.get());
            Assert.fail();
View Full Code Here

    @Test
    public void testConnectBadRequest() {
        ConnectionPool<TestClient> pool = createPool();

        pool.addHost(new Host("127.0.0.1",
                TestHostType.CONNECT_BAD_REQUEST_EXCEPTION.ordinal()), true);

        try {
            pool.executeWithFailover(dummyOperation, RunOnce.get());
            Assert.fail();
View Full Code Here

    @Test
    public void testThrashingTimeout() {
        ConnectionPool<TestClient> pool = createPool();

        pool.addHost(
                new Host("127.0.0.1", TestHostType.THRASHING_TIMEOUT.ordinal()),
                true);

        for (int i = 0; i < 10; i++) {
            try {
                think(1);
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.connectionpool.Host

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.