org.apache.flume.api
Class RpcClientFactory

java.lang.Object
  extended by org.apache.flume.api.RpcClientFactory

public class RpcClientFactory
extends Object

Factory class to construct Flume RPCClient implementations.


Nested Class Summary
static class RpcClientFactory.ClientType
           
 
Constructor Summary
RpcClientFactory()
           
 
Method Summary
static RpcClient getDefaultInstance(String hostname, Integer port)
          Returns an instance of RpcClient connected to the specified hostname and port.
static RpcClient getDefaultInstance(String hostname, Integer port, Integer batchSize)
          Returns an instance of RpcClient connected to the specified hostname and port with the specified batchSize.
static RpcClient getInstance(File propertiesFile)
          Delegates to getInstance(Properties props), given a File path to a Properties file.
static RpcClient getInstance(Properties properties)
          Returns an instance of RpcClient, optionally with failover.
static RpcClient getInstance(String hostname, Integer port)
          Deprecated.  
static RpcClient getInstance(String hostname, Integer port, Integer batchSize)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RpcClientFactory

public RpcClientFactory()
Method Detail

getInstance

public static RpcClient getInstance(Properties properties)
                             throws FlumeException
Returns an instance of RpcClient, optionally with failover. To create a failover client, the properties object should have a property client.type which has the value "failover". The client connects to hosts specified by hosts property in given properties.

Parameters:
properties - The properties to instantiate the client with.
Throws:
FlumeException
See Also:

If no client.type is specified, a default client that connects to single host at a given port is created.(type can also simply be DEFAULT for the default client)., org.apache.flume.api.NettyAvroClient


getInstance

public static RpcClient getInstance(File propertiesFile)
                             throws FileNotFoundException,
                                    IOException
Delegates to getInstance(Properties props), given a File path to a Properties file.

Parameters:
propertiesFile - Valid properties file
Returns:
RpcClient configured according to the given Properties file.
Throws:
FileNotFoundException - If the file cannot be found
IOException - If there is an IO error

getInstance

@Deprecated
public static RpcClient getInstance(String hostname,
                                               Integer port)
                             throws FlumeException
Deprecated. 

Deprecated. Use getDefaultInstance(String, Integer) instead.

Throws:
FlumeException

getDefaultInstance

public static RpcClient getDefaultInstance(String hostname,
                                           Integer port)
                                    throws FlumeException
Returns an instance of RpcClient connected to the specified hostname and port.

Throws:
FlumeException

getInstance

@Deprecated
public static RpcClient getInstance(String hostname,
                                               Integer port,
                                               Integer batchSize)
                             throws FlumeException
Deprecated. 

Deprecated. Use getDefaultInstance(String, Integer, Integer) instead.

Throws:
FlumeException

getDefaultInstance

public static RpcClient getDefaultInstance(String hostname,
                                           Integer port,
                                           Integer batchSize)
                                    throws FlumeException
Returns an instance of RpcClient connected to the specified hostname and port with the specified batchSize.

Throws:
FlumeException


Copyright © 2009-2012 Apache Software Foundation. All Rights Reserved.