public class RpcClientFactory extends Object
RPCClient
implementations.Modifier and Type | Class and Description |
---|---|
static class |
RpcClientFactory.ClientType |
Constructor and Description |
---|
RpcClientFactory() |
Modifier and Type | Method and Description |
---|---|
static RpcClient |
getDefaultInstance(String hostname,
Integer 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.
|
static RpcClient |
getThriftInstance(Properties props)
Return an RpcClient that uses Thrift for communicating with
the next hop.
|
static RpcClient |
getThriftInstance(String hostname,
Integer port)
Return an RpcClient that uses Thrift for communicating with
the next hop.
|
static RpcClient |
getThriftInstance(String hostname,
Integer port,
Integer batchSize)
Return an RpcClient that uses Thrift for communicating with
the next hop.
|
public static RpcClient getInstance(Properties properties) throws FlumeException
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.properties
- The properties to instantiate the client with.FlumeException
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
public static RpcClient getInstance(File propertiesFile) throws FileNotFoundException, IOException
getInstance(Properties props)
, given a File path
to a Properties
file.propertiesFile
- Valid properties fileFileNotFoundException
- If the file cannot be foundIOException
- If there is an IO error@Deprecated public static RpcClient getInstance(String hostname, Integer port) throws FlumeException
getDefaultInstance(String, Integer)
instead.FlumeException
public static RpcClient getDefaultInstance(String hostname, Integer port) throws FlumeException
FlumeException
@Deprecated public static RpcClient getInstance(String hostname, Integer port, Integer batchSize) throws FlumeException
getDefaultInstance(String, Integer, Integer)
instead.FlumeException
public static RpcClient getDefaultInstance(String hostname, Integer port, Integer batchSize) throws FlumeException
RpcClient
connected to the specified
hostname
and port
with the specified batchSize
.FlumeException
public static RpcClient getThriftInstance(String hostname, Integer port, Integer batchSize)
hostname
- - The hostname of the next hop.port
- - The port on which the ThriftSource is listeningbatchSize
- - batch size of each transaction.public static RpcClient getThriftInstance(String hostname, Integer port)
hostname
- - The hostname of the next hop.port
- - The port on which the ThriftSource is listeningpublic static RpcClient getThriftInstance(Properties props)
props
- Copyright © 2009–2019 Apache Software Foundation. All rights reserved.