You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by "Bryce Brooks (Jira)" <ji...@apache.org> on 2020/05/26 15:53:00 UTC

[jira] [Created] (ARROW-8949) Java Flight - getInfo() returning 0.0.0.0:47470

Bryce Brooks created ARROW-8949:
-----------------------------------

             Summary: Java Flight - getInfo() returning 0.0.0.0:47470
                 Key: ARROW-8949
                 URL: https://issues.apache.org/jira/browse/ARROW-8949
             Project: Apache Arrow
          Issue Type: Bug
          Components: FlightRPC, Java
    Affects Versions: 0.17.1
            Reporter: Bryce Brooks


The code below is incomplete but I thought it would be good to show how I am connecting. The server is Dremio. The python client works fine when I attempt a simple test. I am not sure what is going on with the Java client but the getInfo returns an endpoint location of 0.0.0.0:47470. 

The info object i get back is:

info: FlightInfo\{schema=Schema<TABLE_NAME: Utf8>, descriptor=53 45 4C 45 43 54 20 54 41 42 4C 45 5F 4E 41 4D 45 20 46 52 4F 4D 20 49 4E 46 4F 52 4D 41 54 49 4F 4E 5F 53 43 48 45 4D 41 2E 56 49 45 57 53 , endpoints=[FlightEndpoint{locations=[Location{uri=grpc+tcp://0.0.0.0:47470}], ticket=org.apache.arrow.flight.Ticket@1ad0dd97}], bytes=-1, records=-1}

 
{code:java}
// 
private void testConnect() {        
  final String host = "somehost"; // removed for security
  final int port = 1234;  // removed for security
  final Location location = Location.forGrpcInsecure(host, port);
  try (FlightClient c = flightClient(allocator, location)) {        
     c.authenticate(new BasicClientAuthHandler("username", "password"));                
     String sql = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS";               
     FlightInfo info = c.getInfo(FlightDescriptor.command(sql.getBytes()));            
     log.info("info: " + info.toString());            
     log.info("      " + info.getDescriptor().toString());            
     log.info("      " + info.getSchema().toString());            
     log.info("      " + info.getEndpoints().size());             
     long total = info.getEndpoints().stream()
        .map(this::submit)
        .map(DataApiApplication::get)
        .mapToLong(Long::longValue)
        .sum();
      log.info("****************" + total);        
   } catch (Exception e) {            
      log.error("ERROR DURING GET");            
      log.error(e.getMessage());            
      log.error(e.getLocalizedMessage());        
   }    
}

private Future<Long> submit(FlightEndpoint e) {      
   int thisEndpoint = endpointsSubmitted.incrementAndGet();      
   log.debug("submitting flight endpoint {} with ticket {} to {}",   
               thisEndpoint, 
               new String(e.getTicket().getBytes()), 
               e.getLocations().get(0).getUri());
   RunnableReader reader = new RunnableReader(allocator, e);
   Future<Long> f = tp.submit(reader);
   log.debug("submitted flight endpoint {} with ticket {} to {}", 
      thisEndpoint, 
      new String(e.getTicket().getBytes()), 
      e.getLocations().get(0).getUri());      
   return f;    
}{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)