本文整理匯總了Java中org.apache.thrift.transport.TTransportException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java TTransportException.printStackTrace方法的具體用法?Java TTransportException.printStackTrace怎麽用?Java TTransportException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.thrift.transport.TTransportException
的用法示例。
在下文中一共展示了TTransportException.printStackTrace方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: userProfileClient
import org.apache.thrift.transport.TTransportException; //導入方法依賴的package包/類
public static UserProfileService.Client userProfileClient(String serverHost, int serverPort) throws Exception{
try {
TTransport transport = new TSocket(serverHost, serverPort);
transport.open();
TProtocol protocol = new TBinaryProtocol(transport);
TMultiplexedProtocol multiplexedProtocol = new TMultiplexedProtocol(protocol, "UserProfileService");
return new UserProfileService.Client(multiplexedProtocol);
} catch (TTransportException e) {
e.printStackTrace();
throw new Exception("Could not connect to user profile server");
}
}
示例2: NaviHiveClientDriver
import org.apache.thrift.transport.TTransportException; //導入方法依賴的package包/類
public NaviHiveClientDriver(ServerUrlUtil.ServerUrl server, String auth,
NaviPoolConfig poolConfig) {
super(server, auth, poolConfig);
try {
transport = new TSocket(server.getHost(), server.getPort());
TProtocol protocol = new TBinaryProtocol(transport);
client = new HiveClient(protocol);
transport.open();
} catch (TTransportException e) {
e.printStackTrace();
}
}
示例3: open
import org.apache.thrift.transport.TTransportException; //導入方法依賴的package包/類
public boolean open() {
if (!transport.isOpen()) {
try {
transport.open();
} catch (TTransportException e) {
e.printStackTrace();
return false;
}
}
return true;
}