org.apache.blur.thrift
Class BlurClientManager

java.lang.Object
  extended by org.apache.blur.thrift.BlurClientManager

public class BlurClientManager
extends Object


Field Summary
static long BACK_OFF_TIME
           
static long MAX_BACK_OFF_TIME
           
static int MAX_RETRIES
           
 
Constructor Summary
BlurClientManager()
           
 
Method Summary
static void close(Blur.Client client)
           
static
<CLIENT,T> T
execute(Connection connection, AbstractCommand<CLIENT,T> command)
           
static
<CLIENT,T> T
execute(Connection connection, AbstractCommand<CLIENT,T> command, int maxRetries, long backOffTime, long maxBackOffTime)
           
static
<CLIENT,T> T
execute(List<Connection> connections, AbstractCommand<CLIENT,T> command)
           
static
<CLIENT,T> T
execute(List<Connection> connections, AbstractCommand<CLIENT,T> command, int maxRetries, long backOffTime, long maxBackOffTime)
           
static
<CLIENT,T> T
execute(String connectionStr, AbstractCommand<CLIENT,T> command)
           
static
<CLIENT,T> T
execute(String connectionStr, AbstractCommand<CLIENT,T> command, int maxRetries, long backOffTime, long maxBackOffTime)
           
static ClientPool getClientPool()
           
static List<Connection> getConnections(String connectionStr)
           
static Blur.Client newClient(Connection connection)
           
static void returnClient(Connection connection, java.util.concurrent.atomic.AtomicReference<Blur.Client> client)
           
static void returnClient(Connection connection, Blur.Client client)
           
static void setClientPool(ClientPool clientPool)
           
static void sleep(long backOffTime, long maxBackOffTime, int retry, int maxRetries)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_RETRIES

public static final int MAX_RETRIES
See Also:
Constant Field Values

BACK_OFF_TIME

public static final long BACK_OFF_TIME

MAX_BACK_OFF_TIME

public static final long MAX_BACK_OFF_TIME
Constructor Detail

BlurClientManager

public BlurClientManager()
Method Detail

setClientPool

public static void setClientPool(ClientPool clientPool)

getClientPool

public static ClientPool getClientPool()

execute

public static <CLIENT,T> T execute(Connection connection,
                                   AbstractCommand<CLIENT,T> command)
                 throws BlurException,
                        TException,
                        IOException
Throws:
BlurException
TException
IOException

execute

public static <CLIENT,T> T execute(Connection connection,
                                   AbstractCommand<CLIENT,T> command,
                                   int maxRetries,
                                   long backOffTime,
                                   long maxBackOffTime)
                 throws BlurException,
                        TException,
                        IOException
Throws:
BlurException
TException
IOException

execute

public static <CLIENT,T> T execute(List<Connection> connections,
                                   AbstractCommand<CLIENT,T> command)
                 throws BlurException,
                        TException,
                        IOException
Throws:
BlurException
TException
IOException

execute

public static <CLIENT,T> T execute(List<Connection> connections,
                                   AbstractCommand<CLIENT,T> command,
                                   int maxRetries,
                                   long backOffTime,
                                   long maxBackOffTime)
                 throws BlurException,
                        TException,
                        IOException
Throws:
BlurException
TException
IOException

sleep

public static void sleep(long backOffTime,
                         long maxBackOffTime,
                         int retry,
                         int maxRetries)

execute

public static <CLIENT,T> T execute(String connectionStr,
                                   AbstractCommand<CLIENT,T> command,
                                   int maxRetries,
                                   long backOffTime,
                                   long maxBackOffTime)
                 throws BlurException,
                        TException,
                        IOException
Throws:
BlurException
TException
IOException

getConnections

public static List<Connection> getConnections(String connectionStr)

execute

public static <CLIENT,T> T execute(String connectionStr,
                                   AbstractCommand<CLIENT,T> command)
                 throws BlurException,
                        TException,
                        IOException
Throws:
BlurException
TException
IOException

returnClient

public static void returnClient(Connection connection,
                                java.util.concurrent.atomic.AtomicReference<Blur.Client> client)

returnClient

public static void returnClient(Connection connection,
                                Blur.Client client)

close

public static void close(Blur.Client client)

newClient

public static Blur.Client newClient(Connection connection)
                             throws TTransportException,
                                    IOException
Throws:
TTransportException
IOException


Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.