本文整理汇总了Java中org.apache.thrift7.transport.TTransportException类的典型用法代码示例。如果您正苦于以下问题:Java TTransportException类的具体用法?Java TTransportException怎么用?Java TTransportException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TTransportException类属于org.apache.thrift7.transport包,在下文中一共展示了TTransportException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initThrift
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
private void initThrift(Map conf) throws TTransportException {
Integer thrift_port = JStormUtils.parseInt(conf
.get(Config.NIMBUS_THRIFT_PORT));
TNonblockingServerSocket socket = new TNonblockingServerSocket(
thrift_port);
Integer maxReadBufSize = JStormUtils.parseInt(conf
.get(Config.NIMBUS_THRIFT_MAX_BUFFER_SIZE));
THsHaServer.Args args = new THsHaServer.Args(socket);
args.workerThreads(ServiceHandler.THREAD_NUM);
args.protocolFactory(new TBinaryProtocol.Factory(false, true,
maxReadBufSize));
args.processor(new Nimbus.Processor<Iface>(serviceHandler));
args.maxReadBufferBytes = maxReadBufSize;
thriftServer = new THsHaServer(args);
LOG.info("Successfully started nimbus: started Thrift server...");
thriftServer.serve();
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:23,代码来源:NimbusServer.java
示例2: getServer
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
@Override
public TServer getServer(int port, TProcessor processor)
throws IOException, TTransportException {
TTransportFactory serverTransportFactory = getServerTransportFactory();
// define THsHaServer args
// original: THsHaServer + TNonblockingServerSocket
// option: TThreadPoolServer + TServerSocket
TServerSocket serverTransport = new TServerSocket(port);
TThreadPoolServer.Args server_args = new TThreadPoolServer.Args(
serverTransport).processor(new TUGIWrapProcessor(processor))
.minWorkerThreads(64).maxWorkerThreads(64)
.protocolFactory(new TBinaryProtocol.Factory());
if (serverTransportFactory != null)
server_args.transportFactory(serverTransportFactory);
// construct THsHaServer
return new TThreadPoolServer(server_args);
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:20,代码来源:SaslTransportPlugin.java
示例3: getConfiguredClient
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
public static MasterClient getConfiguredClient(Map conf) throws Exception {
try {
String masterHost = (String) conf.get(Config.MASTER_HOST);
// String zookeeper = conf.get(Config.)
LOG.info("masterHost is:" + masterHost);
int masterPort = Utils.getInt(conf.get(Config.MASTER_THRIFT_PORT));
LOG.info("masterPort is" + masterPort);
System.out.println("masterPort is" + masterPort);
try {
Integer timeout = Utils.getInt(conf.get(Config.MASTER_TIMEOUT_SECS));
return new MasterClient(conf, masterHost, masterPort, timeout);
} catch (IllegalArgumentException e) {
return new MasterClient(conf, masterHost, masterPort, null);
}
} catch (TTransportException ex) {
throw new RuntimeException(ex);
}
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:22,代码来源:MasterClient.java
示例4: initThrift
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
private void initThrift(Map conf) throws TTransportException {
Integer thrift_port = JStormUtils.parseInt(conf.get(Config.NIMBUS_THRIFT_PORT));
TNonblockingServerSocket socket = new TNonblockingServerSocket(thrift_port);
Integer maxReadBufSize = JStormUtils.parseInt(conf.get(Config.NIMBUS_THRIFT_MAX_BUFFER_SIZE));
THsHaServer.Args args = new THsHaServer.Args(socket);
args.workerThreads(ServiceHandler.THREAD_NUM);
args.protocolFactory(new TBinaryProtocol.Factory(false, true, maxReadBufSize));
args.processor(new Nimbus.Processor<Iface>(serviceHandler));
args.maxReadBufferBytes = maxReadBufSize;
thriftServer = new THsHaServer(args);
LOG.info("Successfully started nimbus: started Thrift server...");
thriftServer.serve();
}
开发者ID:songtk,项目名称:learn_jstorm,代码行数:20,代码来源:NimbusServer.java
示例5: getServer
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
public TServer getServer(int port, TProcessor processor)
throws IOException, TTransportException {
TTransportFactory serverTransportFactory = getServerTransportFactory();
// define THsHaServer args
// original: THsHaServer + TNonblockingServerSocket
// option: TThreadPoolServer + TServerSocket
TServerSocket serverTransport = new TServerSocket(port);
TThreadPoolServer.Args server_args = new TThreadPoolServer.Args(
serverTransport).processor(new TUGIWrapProcessor(processor))
.minWorkerThreads(64).maxWorkerThreads(64)
.protocolFactory(new TBinaryProtocol.Factory());
if (serverTransportFactory != null)
server_args.transportFactory(serverTransportFactory);
// construct THsHaServer
return new TThreadPoolServer(server_args);
}
开发者ID:songtk,项目名称:learn_jstorm,代码行数:19,代码来源:SaslTransportPlugin.java
示例6: initThrift
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
private void initThrift(Map conf) throws TTransportException {
Integer thrift_port = JStormUtils.parseInt(conf
.get(Config.NIMBUS_THRIFT_PORT));
TNonblockingServerSocket socket = new TNonblockingServerSocket(
thrift_port);
Integer maxReadBufSize = JStormUtils.parseInt(conf
.get(Config.NIMBUS_THRIFT_MAX_BUFFER_SIZE));
THsHaServer.Args args = new THsHaServer.Args(socket);
args.workerThreads(ServiceHandler.THREAD_NUM);
args.protocolFactory(new TBinaryProtocol.Factory(false, true,
maxReadBufSize));
args.processor(new Nimbus.Processor<Iface>(serviceHandler));
args.maxReadBufferBytes = maxReadBufSize;
thriftServer = new THsHaServer(args);
LOG.info("Successfully started nimbus: started Thrift server...");
thriftServer.serve();
}
开发者ID:greeenSY,项目名称:Tstream,代码行数:24,代码来源:NimbusServer.java
示例7: getConfiguredClient
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public static MasterClient getConfiguredClient(Map conf) {
try {
String masterHost = (String) conf.get(Config.MASTER_HOST);
int masterPort = Utils.getInt(conf.get(Config.MASTER_THRIFT_PORT));
try {
Integer timeout = Utils.getInt(conf.get(Config.MASTER_TIMEOUT_SECS));
return new MasterClient(conf, masterHost, masterPort, timeout);
} catch (IllegalArgumentException e) {
return new MasterClient(conf, masterHost, masterPort, null);
}
} catch (TTransportException ex) {
throw new RuntimeException(ex);
}
}
开发者ID:yahoo,项目名称:storm-yarn,代码行数:17,代码来源:MasterClient.java
示例8: nimbusClientandConn
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
public static List nimbusClientandConn(String host, Integer port)
throws TTransportException {
TSocket ts = new TSocket(host, port);
TFramedTransport tt = new TFramedTransport(ts);
TBinaryProtocol prot = new TBinaryProtocol(tt);
Client nc = new Client(prot);
ts.open();
List l = new ArrayList();
l.add(nc);
l.add(tt);
return l;
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:13,代码来源:UIUtils.java
示例9: connect
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
@Override
public TTransport connect(TTransport transport, String serverHost)
throws TTransportException, IOException {
ClientCallbackHandler client_callback_handler = new ClientCallbackHandler(
login_conf);
TSaslClientTransport wrapper_transport = new TSaslClientTransport(
DIGEST, null, AuthUtils.SERVICE, serverHost, null,
client_callback_handler, transport);
wrapper_transport.open();
LOG.debug("SASL DIGEST-MD5 client transport has been established");
return wrapper_transport;
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:15,代码来源:DigestSaslTransportPlugin.java
示例10: getServer
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
/**
* We will let Thrift to apply default transport factory
*/
@Override
public TServer getServer(int port, TProcessor processor)
throws IOException, TTransportException {
TNonblockingServerSocket serverTransport = new TNonblockingServerSocket(
port);
THsHaServer.Args server_args = new THsHaServer.Args(serverTransport)
.processor(new SimpleWrapProcessor(processor))
.workerThreads(64)
.protocolFactory(new TBinaryProtocol.Factory());
// construct THsHaServer
return new THsHaServer(server_args);
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:17,代码来源:SimpleTransportPlugin.java
示例11: connect
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
/**
* Connect to the specified server via framed transport
*
* @param transport
* The underlying Thrift transport.
*/
@Override
public TTransport connect(TTransport transport, String serverHost)
throws TTransportException {
// create a framed transport
TTransport conn = new TFramedTransport(transport);
// connect
conn.open();
LOG.debug("Simple client transport has been established");
return conn;
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:19,代码来源:SimpleTransportPlugin.java
示例12: getServer
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
/**
* We will let Thrift to apply default transport factory
*/
public TServer getServer(int port, TProcessor processor) throws IOException, TTransportException {
TNonblockingServerSocket serverTransport = new TNonblockingServerSocket(port);
THsHaServer.Args server_args = new THsHaServer.Args(serverTransport).
processor(new SimpleWrapProcessor(processor)).
workerThreads(64).
protocolFactory(new TBinaryProtocol.Factory());
//construct THsHaServer
return new THsHaServer(server_args);
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:14,代码来源:SimpleTransportPlugin.java
示例13: connect
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
/**
* Connect to the specified server via framed transport
* @param transport The underlying Thrift transport.
*/
public TTransport connect(TTransport transport, String serverHost) throws TTransportException {
//create a framed transport
TTransport conn = new TFramedTransport(transport);
//connect
conn.open();
LOG.debug("Simple client transport has been established");
return conn;
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:15,代码来源:SimpleTransportPlugin.java
示例14: connect
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
public TTransport connect(TTransport transport, String serverHost)
throws TTransportException, IOException {
ClientCallbackHandler client_callback_handler = new ClientCallbackHandler(
login_conf);
TSaslClientTransport wrapper_transport = new TSaslClientTransport(
DIGEST, null, AuthUtils.SERVICE, serverHost, null,
client_callback_handler, transport);
wrapper_transport.open();
LOG.debug("SASL DIGEST-MD5 client transport has been established");
return wrapper_transport;
}
开发者ID:songtk,项目名称:learn_jstorm,代码行数:14,代码来源:DigestSaslTransportPlugin.java
示例15: getServer
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
/**
* We will let Thrift to apply default transport factory
*/
public TServer getServer(int port, TProcessor processor)
throws IOException, TTransportException {
TNonblockingServerSocket serverTransport = new TNonblockingServerSocket(
port);
THsHaServer.Args server_args = new THsHaServer.Args(serverTransport)
.processor(new SimpleWrapProcessor(processor))
.workerThreads(64)
.protocolFactory(new TBinaryProtocol.Factory());
// construct THsHaServer
return new THsHaServer(server_args);
}
开发者ID:songtk,项目名称:learn_jstorm,代码行数:16,代码来源:SimpleTransportPlugin.java
示例16: connect
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
/**
* Connect to the specified server via framed transport
*
* @param transport
* The underlying Thrift transport.
*/
public TTransport connect(TTransport transport, String serverHost)
throws TTransportException {
// create a framed transport
TTransport conn = new TFramedTransport(transport);
// connect
conn.open();
LOG.debug("Simple client transport has been established");
return conn;
}
开发者ID:songtk,项目名称:learn_jstorm,代码行数:18,代码来源:SimpleTransportPlugin.java
示例17: ThriftClient
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
public ThriftClient(Map storm_conf, String host, int port) throws TTransportException {
this(storm_conf, host, port, null);
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:4,代码来源:ThriftClient.java
示例18: failover
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
/**
* Performs a failover, e.g., when a network connection closed due to failures.
*
* @param th the throwable causing the need for failover
*/
public void failover(Throwable th) {
if ((th instanceof TTransportException) || (th instanceof SocketException)) {
close(); // hope that it silently closes and a reconnect happens in the next round
}
}
开发者ID:QualiMaster,项目名称:Infrastructure,代码行数:11,代码来源:StormConnection.java
示例19: MasterClient
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public MasterClient(Map conf, String host, int port, Integer timeout) throws TTransportException {
super(conf, host, port, timeout);
_client = new StormMaster.Client(_protocol);
}
开发者ID:yahoo,项目名称:storm-yarn,代码行数:6,代码来源:MasterClient.java
示例20: getServer
import org.apache.thrift7.transport.TTransportException; //导入依赖的package包/类
/**
* Create a server associated with a given port and service handler
*
* @param port
* listening port
* @param processor
* service handler
* @return server to be binded
*/
public TServer getServer(int port, TProcessor processor)
throws IOException, TTransportException;
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:12,代码来源:ITransportPlugin.java
注:本文中的org.apache.thrift7.transport.TTransportException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论