gooddata 2.1.11-java → 2.1.16-java

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of gooddata might be problematic. Click here for more details.

Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.gdc-ii-config.yaml +1 -1
  3. data/.sonar.settings +4 -0
  4. data/.travis.yml +4 -3
  5. data/CHANGELOG.md +34 -0
  6. data/Dockerfile +9 -3
  7. data/LICENSE +4418 -17
  8. data/LICENSE.rb +1 -1
  9. data/LICENSE_FOR_RUBY_SDK_COMPONENT.txt +4423 -0
  10. data/NOTICES.txt +6692 -0
  11. data/README.md +19 -1
  12. data/Rakefile +5 -1
  13. data/SDK_VERSION +1 -1
  14. data/VERSION +1 -1
  15. data/bin/run_brick.rb +3 -0
  16. data/bin/test_projects_cleanup.rb +7 -3
  17. data/ci/postgresql/pom.xml +57 -0
  18. data/dev-gooddata-sso.pub.encrypted +40 -40
  19. data/gdc_fossa_lcm.yaml +2 -0
  20. data/gdc_fossa_ruby_sdk.yaml +5 -0
  21. data/gooddata.gemspec +3 -4
  22. data/k8s/charts/lcm-bricks/Chart.yaml +1 -1
  23. data/k8s/charts/lcm-bricks/templates/prometheus/alertingRules.yaml +32 -12
  24. data/lib/gooddata.rb +2 -0
  25. data/lib/gooddata/cloud_resources/{cloud_resouce_factory.rb → cloud_resource_factory.rb} +8 -0
  26. data/lib/gooddata/cloud_resources/cloud_resources.rb +1 -1
  27. data/lib/gooddata/cloud_resources/postgresql/drivers/.gitkeepme +0 -0
  28. data/lib/gooddata/cloud_resources/postgresql/postgresql_client.rb +107 -0
  29. data/lib/gooddata/commands/scaffold.rb +9 -10
  30. data/lib/gooddata/core/nil_logger.rb +3 -1
  31. data/lib/gooddata/helpers/data_helper.rb +1 -2
  32. data/lib/gooddata/helpers/global_helpers.rb +6 -5
  33. data/lib/gooddata/helpers/global_helpers_params.rb +2 -2
  34. data/lib/gooddata/lcm/actions/base_action.rb +0 -2
  35. data/lib/gooddata/lcm/actions/collect_tagged_objects.rb +2 -1
  36. data/lib/gooddata/lcm/actions/migrate_gdc_date_dimension.rb +116 -0
  37. data/lib/gooddata/lcm/actions/synchronize_ldm.rb +10 -1
  38. data/lib/gooddata/lcm/actions/synchronize_user_filters.rb +4 -0
  39. data/lib/gooddata/lcm/actions/synchronize_users.rb +7 -6
  40. data/lib/gooddata/lcm/lcm2.rb +1 -2
  41. data/lib/gooddata/lcm/types/base_type.rb +0 -2
  42. data/lib/gooddata/mixins/md_object_query.rb +8 -6
  43. data/lib/gooddata/models/blueprint/project_blueprint.rb +0 -2
  44. data/lib/gooddata/models/client.rb +14 -12
  45. data/lib/gooddata/models/data_source.rb +664 -0
  46. data/lib/gooddata/models/domain.rb +1 -2
  47. data/lib/gooddata/models/from_wire.rb +1 -0
  48. data/lib/gooddata/models/metadata/scheduled_mail.rb +1 -1
  49. data/lib/gooddata/models/process.rb +11 -3
  50. data/lib/gooddata/models/project.rb +128 -19
  51. data/lib/gooddata/models/user_filters/user_filter_builder.rb +0 -1
  52. data/lib/gooddata/models/user_group.rb +0 -1
  53. data/lib/gooddata/rest/connection.rb +6 -4
  54. data/rubydev_public.gpg.encrypted +51 -51
  55. data/rubydev_secret_keys.gpg.encrypted +109 -109
  56. metadata +18 -23
  57. data/DEPENDENCIES.md +0 -880
data/README.md CHANGED
@@ -9,6 +9,8 @@ The best documentation for the GoodData API can be found using these resources:
9
9
  * http://developer.gooddata.com/api
10
10
  * https://secure.gooddata.com/gdc
11
11
  * http://rubydoc.info/gems/gooddata/frames
12
+
13
+ Feel free to check out the [GoodData community website](http://community.gooddata.com/) if you have any questions about the GoodData Analytics platform, our API, or this library.
12
14
 
13
15
  ## Status
14
16
 
@@ -19,6 +21,21 @@ The best documentation for the GoodData API can be found using these resources:
19
21
  [![Build Status](https://travis-ci.org/gooddata/gooddata-ruby.png)](https://travis-ci.org/gooddata/gooddata-ruby)
20
22
  [![Coverage Status](https://coveralls.io/repos/gooddata/gooddata-ruby/badge.png)](https://coveralls.io/r/gooddata/gooddata-ruby)
21
23
 
24
+ ## Supported versions
25
+
26
+ In order to make the user experience with integrating GoodData Ruby SDK as smooth and secure as possible and to ensure that the SDK is using the latest features of the platform, we only provide support to the two most recent major versions of Ruby SDK.
27
+
28
+ The most recent majors will be supported in the following modes:
29
+
30
+ - The latest major version will receive all new functionality and all bug fixes.
31
+ - The previous major version will only receive fixes to critical issues and security fixes. These fixes will be applied on top of last released version of the previous major.
32
+ - GoodData customer support will provide support for the latest major and previous major version only.
33
+
34
+ - The customers are encouraged to always use the latest version of the Ruby SDK.
35
+ - In case of using older versions, the user might face API incompatibility, performance or security issues.
36
+
37
+ Please follow the installation instructions in the repository to update to the newest version.
38
+
22
39
  ## Install
23
40
 
24
41
  If you are using bundler, add
@@ -78,4 +95,5 @@ For full contributor info see [contributors page](https://github.com/gooddata/go
78
95
 
79
96
  ## Copyright
80
97
 
81
- Copyright (c) 2010 - 2018 GoodData Corporation and Thomas Watson Steen. See [LICENSE](/LICENSE) for details.
98
+ (c) 2010-2021 GoodData Corporation
99
+ This repository is governed by the terms and conditions in the LICENSE. This repository contains a number of open source packages detailed in NOTICES, including the GoodData Ruby SDK, which is licensed under the BSD-3-Clause license and contains additional open source components detailed in the file called LICENSE_FOR_RUBY_SDK_COMPONENT.
data/Rakefile CHANGED
@@ -33,7 +33,11 @@ namespace :gem do
33
33
  desc "Release gem version #{GoodData::VERSION} to rubygems"
34
34
  task :release do
35
35
  gem = "gooddata-#{GoodData::VERSION}.gem"
36
-
36
+ origin_license_file = 'LICENSE'
37
+ new_license_file = 'LICENSE_FOR_RUBY_SDK_COMPONENT.txt'
38
+ File.delete(origin_license_file) if File.exist?(origin_license_file)
39
+ FileUtils.cp(new_license_file, origin_license_file) if File.exists?(new_license_file)
40
+ puts "Copied file #{new_license_file} to #{origin_license_file}"
37
41
  puts "Building #{gem} ..."
38
42
  res = `gem build ./gooddata.gemspec`
39
43
  file = res.match('File: (.*)')[1]
data/SDK_VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.11
1
+ 2.1.16
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.7.18
1
+ 3.7.25
data/bin/run_brick.rb CHANGED
@@ -8,6 +8,9 @@ DEFAULT_BRICK = 'hello_world_brick'
8
8
  BRICK_PARAM_PREFIX = 'BRICK_PARAM_'
9
9
  HIDDEN_BRICK_PARAMS_PREFIX = 'HIDDEN_BRICK_PARAM_'
10
10
 
11
+ # MSF-17345 Set umask so files are group-writable
12
+ File.umask(0002)
13
+
11
14
  brick_type = !ARGV.empty? ? ARGV[0] : DEFAULT_BRICK
12
15
 
13
16
  def get_brick_params(prefix)
@@ -1,6 +1,6 @@
1
1
  require 'optparse'
2
2
 
3
- example = 'Usage example: GD_ENV=testing GD_SPEC_PASSWORD=secret bundle exec ruby bin/test_projects_cleanup.rb'
3
+ example = 'Usage example: GD_ENV=testing GD_SPEC_PASSWORD= bundle exec ruby bin/test_projects_cleanup.rb'
4
4
 
5
5
  options = {}
6
6
  OptionParser.new do |opts|
@@ -90,7 +90,11 @@ def clean_up!(client, force, days)
90
90
  delete_project_by_title(/LCM spec Client With Conflicting LDM Changes/, projects, days, force)
91
91
  delete_project_by_title(/LCM spec master project/, projects, days, force)
92
92
  delete_project_by_title(/users brick load test/, projects, days, force)
93
- delete_project_by_title(/#transfer_processes and #transfer_schedules test/, projects, days, force)
93
+ delete_project_by_title(/transfer_processes and #transfer_schedules test/, projects, days, force)
94
+ delete_project_by_title(/DailyUse Project for gooddata-ruby integration tests/, projects, days, force)
95
+ delete_project_by_title(/^New project$/, projects, days, force)
96
+ delete_project_by_title(/RubyGem Dev Week test/, projects, days, force)
97
+ delete_project_by_title(/My project from blueprint/, projects, days, force)
94
98
  delete_ads_by_title(/Development ADS/, client, days, force)
95
99
  delete_ads_by_title(/Production ADS/, client, days, force)
96
100
  delete_ads_by_title(/TEST ADS/, client, days, force)
@@ -112,7 +116,7 @@ dev_client = init_client(username, password, "https://#{config[:dev_server]}")
112
116
  prod_client = init_client(username, password, "https://#{config[:prod_server]}")
113
117
 
114
118
  force = options[:force]
115
- days = options[:days] || 14
119
+ days = options[:days] || 3
116
120
  clean_up!(dev_client, force, days)
117
121
  clean_up!(prod_client, force, days)
118
122
 
@@ -0,0 +1,57 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+ <modelVersion>4.0.0</modelVersion>
6
+
7
+ <groupId>com.gooddata.lcm</groupId>
8
+ <artifactId>lcm-postgresql-driver</artifactId>
9
+ <version>1.0-SNAPSHOT</version>
10
+
11
+ <dependencies>
12
+ <dependency>
13
+ <groupId>org.postgresql</groupId>
14
+ <artifactId>postgresql</artifactId>
15
+ <version>42.2.19</version>
16
+ </dependency>
17
+ <dependency>
18
+ <groupId>org.slf4j</groupId>
19
+ <artifactId>slf4j-api</artifactId>
20
+ <version>1.7.2</version>
21
+ </dependency>
22
+ </dependencies>
23
+
24
+ <profiles>
25
+ <profile>
26
+ <id>binary-packaging</id>
27
+ <build>
28
+ <plugins>
29
+ <plugin>
30
+ <artifactId>maven-dependency-plugin</artifactId>
31
+ <executions>
32
+ <execution>
33
+ <phase>package</phase>
34
+ <goals>
35
+ <goal>copy-dependencies</goal>
36
+ </goals>
37
+ <configuration>
38
+ <outputDirectory>${project.build.directory}</outputDirectory>
39
+ <!-- compile scope gives runtime and compile dependencies (skips test deps) -->
40
+ <includeScope>runtime</includeScope>
41
+ </configuration>
42
+ </execution>
43
+ </executions>
44
+ </plugin>
45
+ </plugins>
46
+ </build>
47
+ </profile>
48
+ </profiles>
49
+
50
+ <repositories>
51
+ <repository>
52
+ <id>my-repo1</id>
53
+ <name>my custom repo</name>
54
+ <url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
55
+ </repository>
56
+ </repositories>
57
+ </project>
@@ -1,40 +1,40 @@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w
28
+ RidZK61to+d0esurqvb9HhtoiHzA/S/32cKjTi40NL+iOdM56h3njUr1ZODy
29
+ IVsVD9Tj2dMJuxE54ZBaIS2ll1iJsyoESzPmwxqTa+CXXrORtTQxDf+R2GFj
30
+ pumltSDNWBbhFy2KBRS/HA6Q+AVTDSq7j9Vf5JEVG2k9KN996B3wM4XcI2WI
31
+ BEIC4ZYZeVmVjxUl/hG92gprMPE8dRxcBTYfe6K9u7IP3/4LW6pLZ3QHmOw1
32
+ wF5Q4saoJyqA1MMU5IwRZkGl+ca67LMpo8Yh9mtcJlLHnEMJy6PIglh8I8VV
33
+ eZ9MqIEHHJHxZt80wPXA1Zf2rT+mwXvRc5qpTFyJbJSp0Q7yT4QS1TeQGj3w
34
+ m4W0n8S1wBTIlxXhCr9fF+oRUzwIJrHrLK/CzM3/AhYrOr6EZ25hxy/QIvHE
35
+ 704enmCxx3jCtnYGhwXpVDA1LYGK7cPDA6nWYksHkky/llbgqI32flKjlGXL
36
+ at1RvHggeNuOq7s6HomEoabKh9iEDWKYt1uac6PFnmV3Uvp4MTlxKyV6NXym
37
+ 3tAs6oJOD09yzLXIeDHGMhtzCOq6L0RhescW3P6dVVZ9lBqa+BgUHOdZ5GHL
38
+ Pg55SYbSp4Wd7eXwUAIrP4inRcYoohI/V3m4KMu/nwVF4J7ld+2Dujw4Gvq4
39
+ 2PTOflH374TYY3+CqaFryPBnAi6SWkcSGm3PGQAod6survlAoqkyEC2QMgOA
40
+ nQTzKqg=
@@ -0,0 +1,2 @@
1
+ ---
2
+ fossa_project: "gooddata-ruby-lcm"
@@ -0,0 +1,5 @@
1
+ ---
2
+ generate_attribution_file: true
3
+ fossa_project: "gooddata-ruby-sdk"
4
+ ignored_paths:
5
+ - 'ci/.*'
data/gooddata.gemspec CHANGED
@@ -5,7 +5,7 @@ require 'gooddata/version'
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'gooddata'
7
7
  s.version = GoodData::VERSION
8
- s.licenses = ['BSD']
8
+ s.licenses = ['BSD-3-Clause']
9
9
  s.platform = 'java' if RUBY_PLATFORM =~ /java/
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
@@ -55,14 +55,13 @@ Gem::Specification.new do |s|
55
55
  s.add_development_dependency 'sqlite3' if RUBY_PLATFORM != 'java'
56
56
 
57
57
  if RUBY_VERSION >= '2.5'
58
- s.add_dependency 'activesupport', '> 4.2.9', '< 6.1'
58
+ s.add_dependency 'activesupport', '>= 6.0.3.1', '< 6.2'
59
59
  else
60
- s.add_dependency 'activesupport', '> 4.2.9', '< 6.0'
60
+ s.add_dependency 'activesupport', '>= 5.2.4.3', '< 6.0'
61
61
  end
62
62
 
63
63
  s.add_dependency 'aws-sdk-s3', '~> 1.16'
64
64
  s.add_dependency 'docile', '~> 1.1'
65
- s.add_dependency 'erubis', '~> 2.7'
66
65
  s.add_dependency 'gli', '~> 2.15'
67
66
  s.add_dependency 'gooddata_datawarehouse', '~> 0.0.10' if RUBY_PLATFORM == 'java'
68
67
  s.add_dependency 'highline', '= 2.0.0.pre.develop.14'
@@ -1,4 +1,4 @@
1
1
  apiVersion: v1
2
2
  name: lcm-bricks
3
3
  description: LCM Bricks
4
- version: 2.0.1
4
+ version: 2.0.6
@@ -20,7 +20,7 @@ data:
20
20
  expr: container_pod:lcm_pod_container_status_restarts:increase10m >= 1
21
21
  labels:
22
22
  severity: warning
23
- team: lcm # switch to msf in production
23
+ team: lcm
24
24
  cluster_id: {{ .Values.clusterId }}
25
25
  annotations:
26
26
  description: "There is more than 0 restarts of {{`{{ $labels.pod }}`}} pod in the last 10 minutes"
@@ -28,8 +28,8 @@ data:
28
28
  - alert: "[LCM] Pod has too many restarts on cluster={{ .Values.clusterId }}"
29
29
  expr: container_pod:lcm_pod_container_status_restarts:increase10m >= 2
30
30
  labels:
31
- severity: critical
32
- team: lcm # switch to msf in production
31
+ severity: warning
32
+ team: lcm
33
33
  cluster_id: {{ .Values.clusterId }}
34
34
  annotations:
35
35
  description: "There is more than 1 restart of {{`{{ $labels.pod }}`}} pod in the last 10 minutes"
@@ -40,7 +40,7 @@ data:
40
40
  expr: container_pod:lcm_pod_container_status_oomkilled:increase10m >= 1
41
41
  labels:
42
42
  severity: warning
43
- team: lcm # switch to msf in production
43
+ team: lcm
44
44
  cluster_id: {{ .Values.clusterId }}
45
45
  annotations:
46
46
  description: "{{`{{ $labels.pod }}`}} was OOMKilled in the last 30 minutes. Investigate and/or increase memoryRequest or memoryLimit."
@@ -48,8 +48,8 @@ data:
48
48
  - alert: "[LCM] OOMKill occured on cluster={{ .Values.clusterId }}"
49
49
  expr: container_pod:lcm_pod_container_status_oomkilled:increase10m >= 2
50
50
  labels:
51
- severity: critical
52
- team: lcm # switch to msf in production
51
+ severity: warning
52
+ team: lcm
53
53
  cluster_id: {{ .Values.clusterId }}
54
54
  annotations:
55
55
  description: "{{`{{ $labels.pod }}`}} was OOMKilled in the last 10 minutes. Investigate and/or increase memoryRequest or memoryLimit."
@@ -58,8 +58,8 @@ data:
58
58
  expr: rate(container_cpu_cfs_throttled_seconds_total{namespace='{{ .Release.Namespace }}'}[1m]) > 1
59
59
  for: 5m
60
60
  labels:
61
- severity: critical
62
- team: lcm # switch to msf in production
61
+ severity: warning
62
+ team: lcm
63
63
  cluster_id: {{ .Values.clusterId }}
64
64
  annotations:
65
65
  description: "{{`{{ $labels.pod_name }}`}} container is beeing throttled and probably hit CPU limit. Investigate root cause and increase limit and/or number of replicas if necessary."
@@ -68,8 +68,8 @@ data:
68
68
  expr: rate(jvm_gc_pause_seconds_sum{kubernetes_namespace='{{ .Release.Namespace }}'}[1m]) > 1
69
69
  for: 5m
70
70
  labels:
71
- severity: critical
72
- team: lcm # switch to msf in production
71
+ severity: warning
72
+ team: lcm
73
73
  cluster_id: {{ .Values.clusterId }}
74
74
  annotations:
75
75
  description: "{{`{{ $labels.kubernetes_pod_name }}`}} container is spending too much time in pause garbage collector. Investigate root cause and increase heap size and/or number of replicas if necessary."
@@ -77,9 +77,29 @@ data:
77
77
  - alert: "[LCM] there is more than 100 jobs on cluster={{ .Values.clusterId }}"
78
78
  expr: count(kube_job_info{namespace="lcm"}) > 100
79
79
  labels:
80
- severity: critical
81
- team: lcm # switch to msf in production
80
+ severity: warning
81
+ team: lcm
82
82
  cluster_id: {{ .Values.clusterId }}
83
83
  annotations:
84
84
  description: "There is more than 100 jobs in LCM namespace. They are likely not deleted."
85
85
  summary: "There is more than 100 jobs in LCM namespace."
86
+ - alert: "[LCM] Resource quotas hit CPU limit on cluster={{ .Values.clusterId }}"
87
+ expr: kube_resourcequota{namespace='{{ .Release.Namespace }}',resource="limits.cpu",type="hard"} - ignoring(type) kube_resourcequota{namespace='{{ .Release.Namespace }}',resource="limits.cpu",type="used"} == 0
88
+ labels:
89
+ severity: warning
90
+ team: lcm
91
+ cluster_id: {{ .Values.clusterId }}
92
+ annotations:
93
+ description: "We are hitting CPU limit in LCM namespace."
94
+ summary: "We are hitting CPU limit in LCM namespace."
95
+ - alert: "[LCM] POD is in undesirable state on cluster={{ .Values.clusterId }}"
96
+ expr: kube_pod_status_phase{namespace='{{ .Release.Namespace }}', phase!~"Running|Succeeded|Failed"} > 0
97
+ for: 5m
98
+ labels:
99
+ cluster_id: {{ .Values.clusterId }}
100
+ severity: critical
101
+ team: lcm
102
+ annotations:
103
+ description: "POD {{`{{ $labels.pod }}`}} is not in desirable state"
104
+ summary: "POD is not in desirable state"
105
+ runbook: "https://confluence.intgdc.com/display/plat/Generic+runbooks#Genericrunbooks-Podisinundesirablestate"
data/lib/gooddata.rb CHANGED
@@ -37,3 +37,5 @@ require 'backports/2.1.0/array/to_h'
37
37
 
38
38
  # Helpers
39
39
  require 'gooddata/helpers/global_helpers'
40
+
41
+ require 'active_support/core_ext/hash/compact' unless RUBY_VERSION >= '2.5'
@@ -11,7 +11,15 @@ module GoodData
11
11
  module CloudResources
12
12
  class CloudResourceFactory
13
13
  class << self
14
+ def load_cloud_resource(type)
15
+ base = "#{Pathname(__FILE__).dirname.expand_path}#{File::SEPARATOR}#{type}#{File::SEPARATOR}"
16
+ Dir.glob(base + '**/*.rb').each do |file|
17
+ require file
18
+ end
19
+ end
20
+
14
21
  def create(type, data = {}, opts = {})
22
+ load_cloud_resource(type)
15
23
  clients = CloudResourceClient.descendants.select { |c| c.respond_to?("accept?") && c.send("accept?", type) }
16
24
  raise "DataSource does not support type \"#{type}\"" if clients.empty?
17
25
 
@@ -7,6 +7,6 @@
7
7
  require 'pathname'
8
8
 
9
9
  base = Pathname(__FILE__).dirname.expand_path
10
- Dir.glob(base + '**/*.rb').each do |file|
10
+ Dir.glob(base + '*.rb').each do |file|
11
11
  require file
12
12
  end
@@ -0,0 +1,107 @@
1
+ # encoding: UTF-8
2
+ # frozen_string_literal: true
3
+ #
4
+ # Copyright (c) 2021 GoodData Corporation. All rights reserved.
5
+ # This source code is licensed under the BSD-style license found in the
6
+ # LICENSE file in the root directory of this source tree.
7
+
8
+ require 'securerandom'
9
+ require 'java'
10
+ require 'pathname'
11
+ require_relative '../cloud_resource_client'
12
+
13
+ base = Pathname(__FILE__).dirname.expand_path
14
+ Dir.glob(base + 'drivers/*.jar').each do |file|
15
+ require file unless file.start_with?('lcm-postgresql-driver')
16
+ end
17
+
18
+ module GoodData
19
+ module CloudResources
20
+ class PostgresClient < CloudResourceClient
21
+ JDBC_POSTGRES_PATTERN = %r{jdbc:postgresql:\/\/([^:^\/]+)(:([0-9]+))?(\/)?}
22
+ POSTGRES_DEFAULT_PORT = 5432
23
+ JDBC_POSTGRES_PROTOCOL = 'jdbc:postgresql://'
24
+ SSL_JAVA_FACTORY = '&sslfactory=org.postgresql.ssl.DefaultJavaSSLFactory'
25
+ VERIFY_FULL = 'verify-full'
26
+ PREFER = 'prefer'
27
+ REQUIRE = 'require'
28
+ POSTGRES_SET_SCHEMA_COMMAND = "set search_path to"
29
+ POSTGRES_FETCH_SIZE = 1000
30
+
31
+ class << self
32
+ def accept?(type)
33
+ type == 'postgresql'
34
+ end
35
+ end
36
+
37
+ def initialize(options = {})
38
+ raise("Data Source needs a client to Postgres to be able to query the storage but 'postgresql_client' is empty.") unless options['postgresql_client']
39
+
40
+ if options['postgresql_client']['connection'].is_a?(Hash)
41
+ @database = options['postgresql_client']['connection']['database']
42
+ @schema = options['postgresql_client']['connection']['schema'] || 'public'
43
+ @authentication = options['postgresql_client']['connection']['authentication']
44
+ @ssl_mode = options['postgresql_client']['connection']['sslMode']
45
+ raise "SSL Mode should be prefer, require and verify-full" unless @ssl_mode == 'prefer' || @ssl_mode == 'require' || @ssl_mode == 'verify-full'
46
+
47
+ @url = build_url(options['postgresql_client']['connection']['url'])
48
+ else
49
+ raise('Missing connection info for Postgres client')
50
+ end
51
+
52
+ Java.org.postgresql.Driver
53
+ end
54
+
55
+ def realize_query(query, _params)
56
+ GoodData.gd_logger.info("Realize SQL query: type=postgresql status=started")
57
+
58
+ connect
59
+ filename = "#{SecureRandom.urlsafe_base64(6)}_#{Time.now.to_i}.csv"
60
+ measure = Benchmark.measure do
61
+ statement = @connection.create_statement
62
+ statement.set_fetch_size(POSTGRES_FETCH_SIZE)
63
+ has_result = statement.execute(query)
64
+ if has_result
65
+ result = statement.get_result_set
66
+ metadata = result.get_meta_data
67
+ col_count = metadata.column_count
68
+ CSV.open(filename, 'wb') do |csv|
69
+ csv << Array(1..col_count).map { |i| metadata.get_column_name(i) } # build the header
70
+ csv << Array(1..col_count).map { |i| result.get_string(i)&.to_s } while result.next
71
+ end
72
+ end
73
+ end
74
+ GoodData.gd_logger.info("Realize SQL query: type=postgresql status=finished duration=#{measure.real}")
75
+ filename
76
+ ensure
77
+ @connection&.close
78
+ @connection = nil
79
+ end
80
+
81
+ def connect
82
+ GoodData.logger.info "Setting up connection to Postgresql #{@url}"
83
+
84
+ prop = java.util.Properties.new
85
+ prop.setProperty('user', @authentication['basic']['userName'])
86
+ prop.setProperty('password', @authentication['basic']['password'])
87
+ prop.setProperty('schema', @schema)
88
+
89
+ @connection = java.sql.DriverManager.getConnection(@url, prop)
90
+ statement = @connection.create_statement
91
+ statement.execute("#{POSTGRES_SET_SCHEMA_COMMAND} #{@schema}")
92
+ @connection.set_auto_commit(false)
93
+ end
94
+
95
+ def build_url(url)
96
+ matches = url.scan(JDBC_POSTGRES_PATTERN)
97
+ raise 'Cannot reach the url' unless matches
98
+
99
+ host = matches[0][0]
100
+ port = matches[0][2]&.to_i || POSTGRES_DEFAULT_PORT
101
+ raise "Custom port #{port} is not supported. Remove it or use the default port '5432'" if POSTGRES_DEFAULT_PORT != port
102
+
103
+ "#{JDBC_POSTGRES_PROTOCOL}#{host}:#{port}/#{@database}?sslmode=#{@ssl_mode}#{VERIFY_FULL == @ssl_mode ? SSL_JAVA_FACTORY : ''}"
104
+ end
105
+ end
106
+ end
107
+ end