本文整理汇总了Java中org.apache.hadoop.ipc.TestRPC.TestProtocol.ping方法的典型用法代码示例。如果您正苦于以下问题:Java TestProtocol.ping方法的具体用法?Java TestProtocol.ping怎么用?Java TestProtocol.ping使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.ipc.TestRPC.TestProtocol
的用法示例。
在下文中一共展示了TestProtocol.ping方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testNMAuditLoggerWithIP
import org.apache.hadoop.ipc.TestRPC.TestProtocol; //导入方法依赖的package包/类
/**
* Test {@link NMAuditLogger} with IP set.
*/
@Test
public void testNMAuditLoggerWithIP() throws Exception {
Configuration conf = new Configuration();
// start the IPC server
Server server = new RPC.Builder(conf).setProtocol(TestProtocol.class)
.setInstance(new MyTestRPCServer()).setBindAddress("0.0.0.0")
.setPort(0).setNumHandlers(5).setVerbose(true).build();
server.start();
InetSocketAddress addr = NetUtils.getConnectAddress(server);
// Make a client connection and test the audit log
TestProtocol proxy = (TestProtocol)RPC.getProxy(TestProtocol.class,
TestProtocol.versionID, addr, conf);
// Start the testcase
proxy.ping();
server.stop();
}
示例2: testRMAuditLoggerWithIP
import org.apache.hadoop.ipc.TestRPC.TestProtocol; //导入方法依赖的package包/类
/**
* Test {@link RMAuditLogger} with IP set.
*/
@Test
public void testRMAuditLoggerWithIP() throws Exception {
Configuration conf = new Configuration();
// start the IPC server
Server server = new RPC.Builder(conf).setProtocol(TestProtocol.class)
.setInstance(new MyTestRPCServer()).setBindAddress("0.0.0.0")
.setPort(0).setNumHandlers(5).setVerbose(true).build();
server.start();
InetSocketAddress addr = NetUtils.getConnectAddress(server);
// Make a client connection and test the audit log
TestProtocol proxy = (TestProtocol)RPC.getProxy(TestProtocol.class,
TestProtocol.versionID, addr, conf);
// Start the testcase
proxy.ping();
server.stop();
}
示例3: testAuditLoggerWithIP
import org.apache.hadoop.ipc.TestRPC.TestProtocol; //导入方法依赖的package包/类
/**
* Test {@link AuditLogger} with IP set.
*/
public void testAuditLoggerWithIP() throws Exception {
Configuration conf = new Configuration();
// start the IPC server
Server server = new RPC.Builder(conf).setProtocol(TestProtocol.class)
.setInstance(new MyTestRPCServer()).setBindAddress("0.0.0.0")
.setPort(0).build();
server.start();
InetSocketAddress addr = NetUtils.getConnectAddress(server);
// Make a client connection and test the audit log
TestProtocol proxy = (TestProtocol)RPC.getProxy(TestProtocol.class,
TestProtocol.versionID, addr, conf);
// Start the testcase
proxy.ping();
server.stop();
}
示例4: testAuditLoggerWithIP
import org.apache.hadoop.ipc.TestRPC.TestProtocol; //导入方法依赖的package包/类
/**
* Test {@link AuditLogger} with IP set.
*/
@SuppressWarnings("deprecation")
public void testAuditLoggerWithIP() throws Exception {
Configuration conf = new Configuration();
// start the IPC server
Server server = RPC.getServer(new MyTestRPCServer(), "0.0.0.0", 0, conf);
server.start();
InetSocketAddress addr = NetUtils.getConnectAddress(server);
// Make a client connection and test the audit log
TestProtocol proxy = (TestProtocol)RPC.getProxy(TestProtocol.class,
TestProtocol.versionID, addr, conf);
// Start the testcase
proxy.ping();
server.stop();
}
示例5: testAuditLoggerWithIP
import org.apache.hadoop.ipc.TestRPC.TestProtocol; //导入方法依赖的package包/类
/**
* Test {@link AuditLogger} with IP set.
*/
public void testAuditLoggerWithIP() throws Exception {
Configuration conf = new Configuration();
// start the IPC server
Server server = RPC.getServer(new MyTestRPCServer(), "0.0.0.0", 0, conf);
server.start();
InetSocketAddress addr = NetUtils.getConnectAddress(server);
// Make a client connection and test the audit log
TestProtocol proxy = (TestProtocol)RPC.getProxy(TestProtocol.class,
TestProtocol.versionID, addr, conf);
// Start the testcase
proxy.ping();
server.stop();
}
示例6: testAuditLoggerWithIP
import org.apache.hadoop.ipc.TestRPC.TestProtocol; //导入方法依赖的package包/类
/**
* Test {@link AuditLogger} with IP set.
*/
@Test
public void testAuditLoggerWithIP() throws Exception {
Configuration conf = new Configuration();
// start the IPC server
Server server = new RPC.Builder(conf).setProtocol(TestProtocol.class)
.setInstance(new MyTestRPCServer()).setBindAddress("0.0.0.0")
.setPort(0).build();
server.start();
InetSocketAddress addr = NetUtils.getConnectAddress(server);
// Make a client connection and test the audit log
TestProtocol proxy = (TestProtocol)RPC.getProxy(TestProtocol.class,
TestProtocol.versionID, addr, conf);
// Start the testcase
proxy.ping();
server.stop();
}
示例7: testAuditLoggerWithIP
import org.apache.hadoop.ipc.TestRPC.TestProtocol; //导入方法依赖的package包/类
/**
* Test {@link AuditLogger} with IP set.
*/
public void testAuditLoggerWithIP() throws Exception {
Configuration conf = new Configuration();
// start the IPC server
Server server = RPC.getServer(new MyTestRPCServer(), "0.0.0.0", 0, conf);
server.start();
InetSocketAddress addr = NetUtils.getConnectAddress(server);
// Make a client connection and test the audit log
TestProtocol proxy = (TestProtocol)RPC.getProxy(TestProtocol.class,
TestProtocol.versionID, addr, conf);
// Start the testcase
proxy.ping();
server.stop();
}