java/kudu-client/src/test/java/org/apache/kudu/client/TestConnectToCluster.java
@Test(timeout=60000)
  public void testFallbackConnectRpc() throws Exception {
    MiniKuduCluster cluster = new MiniKuduCluster.MiniKuduClusterBuilder()
        .addMasterFlag("--master_support_connect_to_master_rpc=0")
        .numMasters(1)
        .numTservers(0)
        .build();
    KuduClient c = null;
    try {
      c = new KuduClient.KuduClientBuilder(cluster.getMasterAddresses())
          .build();
      // Call some method which uses the master. This forces us to connect
      // and verifies that the fallback works.
      c.listTabletServers();
    } finally {
      if (c != null) {
        c.close();
      }
      cluster.shutdown();
    }
  }
/**
   * Test that the client properly falls back to the old GetMasterRegistration
   * RPC when connecting to a master which does not support the new
   * ConnectToMaster RPC.
   */
Test that the client properly falls back to the old GetMasterRegistration
RPC when connecting to a master which does not support the new
ConnectToMaster RPC.
Test that the client properly falls back to the old GetMasterRegistration RPC when connecting to a master which does not support the new ConnectToMaster RPC .
@Test(timeout=60000)
  public void testFallbackConnectRpc() throws Exception {
    MiniKuduCluster cluster = new MiniKuduCluster.MiniKuduClusterBuilder()
        .addMasterFlag("--master_support_connect_to_master_rpc=0")
        .numMasters(1)
        .numTservers(0)
        .build();
    KuduClient c = null;
    try {
      c = new KuduClient.KuduClientBuilder(cluster.getMasterAddresses())
          .build();
      c.listTabletServers();
    } finally {
      if (c != null) {
        c.close();
      }
      cluster.shutdown();
    }
  }
@ Test ( timeout = 60000 ) public void testFallbackConnectRpc ( ) throws Exception { MiniKuduCluster cluster = new MiniKuduCluster . MiniKuduClusterBuilder ( ) . addMasterFlag ( "--master_support_connect_to_master_rpc=0" ) . numMasters ( 1 ) . numTservers ( 0 ) . build ( ) ; KuduClient c = null ; try { c = new KuduClient . KuduClientBuilder ( cluster . getMasterAddresses ( ) ) . build ( ) ; c . listTabletServers ( ) ; } finally { if ( c != null ) { c . close ( ) ; } cluster . shutdown ( ) ; } }
Test that the client properly falls back to the old GetMasterRegistration
 RPC when connecting to a master which does not support the new
 ConnectToMaster RPC.
Test that the client properly falls back to the old GetMasterRegistration RPC when connecting to a master which does not support the new ConnectToMaster RPC .
// Call some method which uses the master. This forces us to connect // and verifies that the fallback works.