GyeeSampleImpalaApplicationTests.java 942 B

123456789101112131415161718192021222324252627282930
  1. package com.gyee.impala;
  2. import com.gyee.impala.common.config.datasource.KuduDataSourceConfig;
  3. import org.apache.kudu.client.KuduClient;
  4. import org.apache.kudu.client.KuduException;
  5. import org.apache.kudu.client.KuduTable;
  6. import org.junit.jupiter.api.Test;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.boot.test.context.SpringBootTest;
  9. @SpringBootTest
  10. class GyeeSampleImpalaApplicationTests {
  11. @Autowired
  12. private KuduDataSourceConfig kuduConfig;
  13. @Test
  14. void contextLoads() {
  15. KuduClient kuduClient = new KuduClient
  16. .KuduClientBuilder("192.168.1.65:7051")//7051,21050
  17. .defaultOperationTimeoutMs(6000)
  18. .build();
  19. try {
  20. KuduTable kuduTable = kuduClient.openTable("impala::gyee_sample_kudu.windspeedforecastshortterm");
  21. } catch (KuduException e) {
  22. e.printStackTrace();
  23. }
  24. }
  25. }