Java 类org.apache.hadoop.hbase.ipc.RpcEngine 实例源码

项目:LCIndex-HBase-0.94.16    文件:TestHMasterRPCException.java   
@Test
public void testRPCException() throws Exception {
  HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
  TEST_UTIL.startMiniZKCluster();
  Configuration conf = TEST_UTIL.getConfiguration();
  conf.set(HConstants.MASTER_PORT, "0");

  HMaster hm = new HMaster(conf);

  ServerName sm = hm.getServerName();
  InetSocketAddress isa = new InetSocketAddress(sm.getHostname(), sm.getPort());
  RpcEngine rpcEngine = null;
  try {
    rpcEngine = HBaseRPC.getProtocolEngine(conf);
    HMasterInterface inf = rpcEngine.getProxy(
        HMasterInterface.class,  HMasterInterface.VERSION, isa, conf, 100 * 10);
    inf.isMasterRunning();
    fail();
  } catch (RemoteException ex) {
    assertTrue(ex.getMessage().startsWith(
        "org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet"));
  } catch (Throwable t) {
    fail("Unexpected throwable: " + t);
  } finally {
    if (rpcEngine != null) {
      rpcEngine.close();
    }
  }
}
项目:IRIndex    文件:TestHMasterRPCException.java   
@Test
public void testRPCException() throws Exception {
  HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
  TEST_UTIL.startMiniZKCluster();
  Configuration conf = TEST_UTIL.getConfiguration();
  conf.set(HConstants.MASTER_PORT, "0");

  HMaster hm = new HMaster(conf);

  ServerName sm = hm.getServerName();
  InetSocketAddress isa = new InetSocketAddress(sm.getHostname(), sm.getPort());
  RpcEngine rpcEngine = null;
  try {
    rpcEngine = HBaseRPC.getProtocolEngine(conf);
    HMasterInterface inf = rpcEngine.getProxy(
        HMasterInterface.class,  HMasterInterface.VERSION, isa, conf, 100 * 10);
    inf.isMasterRunning();
    fail();
  } catch (RemoteException ex) {
    assertTrue(ex.getMessage().startsWith(
        "org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet"));
  } catch (Throwable t) {
    fail("Unexpected throwable: " + t);
  } finally {
    if (rpcEngine != null) {
      rpcEngine.close();
    }
  }
}
项目:HBase-Research    文件:TestHMasterRPCException.java   
@Test
public void testRPCException() throws Exception {
  HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
  TEST_UTIL.startMiniZKCluster();
  Configuration conf = TEST_UTIL.getConfiguration();
  conf.set(HConstants.MASTER_PORT, "0");

  HMaster hm = new HMaster(conf);

  ServerName sm = hm.getServerName();
  InetSocketAddress isa = new InetSocketAddress(sm.getHostname(), sm.getPort());
  RpcEngine rpcEngine = null;
  try {
    rpcEngine = HBaseRPC.getProtocolEngine(conf);
    HMasterInterface inf = rpcEngine.getProxy(
        HMasterInterface.class,  HMasterInterface.VERSION, isa, conf, 100 * 10);
    inf.isMasterRunning();
    fail();
  } catch (RemoteException ex) {
    assertTrue(ex.getMessage().startsWith(
        "org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet"));
  } catch (Throwable t) {
    fail("Unexpected throwable: " + t);
  } finally {
    if (rpcEngine != null) {
      rpcEngine.close();
    }
  }
}
项目:hbase-0.94.8-qod    文件:TestHMasterRPCException.java   
@Test
public void testRPCException() throws Exception {
  HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
  TEST_UTIL.startMiniZKCluster();
  Configuration conf = TEST_UTIL.getConfiguration();
  conf.set(HConstants.MASTER_PORT, "0");

  HMaster hm = new HMaster(conf);

  ServerName sm = hm.getServerName();
  InetSocketAddress isa = new InetSocketAddress(sm.getHostname(), sm.getPort());
  RpcEngine rpcEngine = null;
  try {
    rpcEngine = HBaseRPC.getProtocolEngine(conf);
    HMasterInterface inf = rpcEngine.getProxy(
        HMasterInterface.class,  HMasterInterface.VERSION, isa, conf, 100 * 10);
    inf.isMasterRunning();
    fail();
  } catch (RemoteException ex) {
    assertTrue(ex.getMessage().startsWith(
        "org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet"));
  } catch (Throwable t) {
    fail("Unexpected throwable: " + t);
  } finally {
    if (rpcEngine != null) {
      rpcEngine.close();
    }
  }
}
项目:hbase-0.94.8-qod    文件:TestHMasterRPCException.java   
@Test
public void testRPCException() throws Exception {
  HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
  TEST_UTIL.startMiniZKCluster();
  Configuration conf = TEST_UTIL.getConfiguration();
  conf.set(HConstants.MASTER_PORT, "0");

  HMaster hm = new HMaster(conf);

  ServerName sm = hm.getServerName();
  InetSocketAddress isa = new InetSocketAddress(sm.getHostname(), sm.getPort());
  RpcEngine rpcEngine = null;
  try {
    rpcEngine = HBaseRPC.getProtocolEngine(conf);
    HMasterInterface inf = rpcEngine.getProxy(
        HMasterInterface.class,  HMasterInterface.VERSION, isa, conf, 100 * 10);
    inf.isMasterRunning();
    fail();
  } catch (RemoteException ex) {
    assertTrue(ex.getMessage().startsWith(
        "org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet"));
  } catch (Throwable t) {
    fail("Unexpected throwable: " + t);
  } finally {
    if (rpcEngine != null) {
      rpcEngine.close();
    }
  }
}
项目:hindex    文件:TestHMasterRPCException.java   
@Test
public void testRPCException() throws Exception {
  HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
  TEST_UTIL.startMiniZKCluster();
  Configuration conf = TEST_UTIL.getConfiguration();
  conf.set(HConstants.MASTER_PORT, "0");

  HMaster hm = new HMaster(conf);

  ServerName sm = hm.getServerName();
  InetSocketAddress isa = new InetSocketAddress(sm.getHostname(), sm.getPort());
  RpcEngine rpcEngine = null;
  try {
    rpcEngine = HBaseRPC.getProtocolEngine(conf);
    HMasterInterface inf = rpcEngine.getProxy(
        HMasterInterface.class,  HMasterInterface.VERSION, isa, conf, 100 * 10);
    inf.isMasterRunning();
    fail();
  } catch (RemoteException ex) {
    assertTrue(ex.getMessage().startsWith(
        "org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet"));
  } catch (Throwable t) {
    fail("Unexpected throwable: " + t);
  } finally {
    if (rpcEngine != null) {
      rpcEngine.close();
    }
  }
}