@BeforeClass public static void openMyClient() throws Exception { parent_client = client; client = new DrillClient(config, serviceSet.getCoordinator()); client.setSupportComplexTypes(false); client.connect(); }
this.client.connect(connect, info); } catch (OutOfMemoryException e) { throw new SQLNonTransientConnectionException("Failure creating root allocator", e);
/** * Start's a connection from client to server * @param props - not null {@link Properties} filled with connection url parameters * @throws RpcException */ public void connect(Properties props) throws RpcException { connect(null, props); }
/** * Connects the client to a Drillbit server * * @throws RpcException */ public void connect() throws RpcException { connect(null, new Properties()); }
public synchronized boolean reconnect() { if (client.isActive()) { return true; } int retry = reconnectTimes; while (retry > 0) { retry--; try { Thread.sleep(this.reconnectDelay); // Gets the drillbit endpoints that are ONLINE and excludes the drillbits that are // in QUIESCENT state. This avoids the clients connecting to drillbits that are // shutting down thereby reducing the chances of query failures. final ArrayList<DrillbitEndpoint> endpoints = new ArrayList<>(clusterCoordinator.getOnlineEndPoints()); if (endpoints.isEmpty()) { continue; } client.close(); Collections.shuffle(endpoints); connect(endpoints.iterator().next()); return true; } catch (Exception e) { } } return false; }
client = new DrillClient(config, clusterCoordinator); client.connect();
connect(endpoint); connected = true; logger.info("Successfully connected to server {}:{}", endpoint.getAddress(), endpoint.getUserPort());
this.client.connect(connect, info); } catch (OutOfMemoryException e) { throw new SQLNonTransientConnectionException("Failure creating root allocator", e);