madnetter opened a new issue, #12062:
URL: https://github.com/apache/pinot/issues/12062

   An exception is generated when trying to instantiate a Connection using the 
following method:
   
   ```
   ConnectionFactory.fromController("localhost:9000");
   ```
   
   Exception:
   ```
    org.apache.pinot.client.PinotClientException: 
java.lang.NumberFormatException: For input string: 
"defaultBrokerUpdateFrequencyInMillis"
        at 
org.apache.pinot.client.ConnectionFactory.fromController(ConnectionFactory.java:126)
 
~[pinot-java-client-1.0.0-hotfix.jar:1.0.0-hotfix-69002e09587c01d2912c3536ced8ea45746c32c7]
        at 
org.apache.pinot.client.ConnectionFactory.fromController(ConnectionFactory.java:112)
 
~[pinot-java-client-1.0.0-hotfix.jar:1.0.0-hotfix-69002e09587c01d2912c3536ced8ea45746c32c7]
        at 
com.vctgroup.monitoring.config.DatasourceConfig.test(DatasourceConfig.java:60) 
~[classes/:na]
        at 
com.vctgroup.monitoring.config.DatasourceConfig.config(DatasourceConfig.java:36)
 ~[classes/:na]
        at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
 ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:578) ~[na:na]
        at 
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMethod.invoke(InitDestroyAnnotationBeanPostProcessor.java:457)
 ~[spring-beans-6.1.1.jar:6.1.1]
        at 
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:401)
 ~[spring-beans-6.1.1.jar:6.1.1]
        at 
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:219)
 ~[spring-beans-6.1.1.jar:6.1.1]
   ```
   
   This appears to occur because of a slight issue in:
    
`pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/BrokerCacheUpdaterPeriodic.java`
   
   The following default value causes the NumberFormatException:
   ```
     public static final String DEFAULT_BROKER_UPDATE_FREQUENCY_MILLIS = 
"defaultBrokerUpdateFrequencyInMillis";
   ```
   When called in:
   
   ```
     public BrokerCacheUpdaterPeriodic(Properties properties, String 
controllerUrl) {
       _properties = properties;
       _brokerCache = new BrokerCache(properties, controllerUrl);
       _scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
       _brokerUpdateFreqInMillis = Long.parseLong(
           properties.getProperty(BROKER_UPDATE_FREQUENCY_MILLIS, 
DEFAULT_BROKER_UPDATE_FREQUENCY_MILLIS));
     }
   ```
   I believe an appropriate solution would be to set the 
DEFAULT_BROKER_UPDATE_FREQUENCY_MILLIS to an appropriate numeric value.
   
   A workaround is to explicitly configure the 'brokerUpdateFrequencyInMillis' 
property. For example:
   ```
   Properties properties = new Properties();
   properties.setProperty("brokerUpdateFrequencyInMillis", "2000");
   Connection conn = ConnectionFactory.fromController(properties, 
"localhost:9000");
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to