6
6
import java .util .Optional ;
7
7
import java .util .stream .Collectors ;
8
8
import java .util .stream .Stream ;
9
+ import javax .sql .DataSource ;
9
10
import org .apache .ignite .Ignite ;
10
11
import org .apache .ignite .Ignition ;
11
12
import org .apache .ignite .lang .IgniteRunnable ;
18
19
import org .heigit .ohsome .oshdb .util .exceptions .OSHDBException ;
19
20
import org .heigit .ohsome .oshdb .util .exceptions .OSHDBTableNotFoundException ;
20
21
import org .heigit .ohsome .oshdb .util .mappable .OSHDBMapReducible ;
22
+ import org .heigit .ohsome .oshdb .util .tagtranslator .JdbcTagTranslator ;
21
23
import org .heigit .ohsome .oshdb .util .tagtranslator .TagTranslator ;
22
24
23
25
/**
@@ -41,7 +43,7 @@ public enum ComputeMode {
41
43
}
42
44
43
45
private final Ignite ignite ;
44
- private final OSHDBDatabase keytables ;
46
+ private final TagTranslator tagTranslator ;
45
47
private final boolean owner ;
46
48
private ComputeMode computeMode = ComputeMode .LOCAL_PEEK ;
47
49
@@ -52,7 +54,7 @@ public enum ComputeMode {
52
54
*
53
55
* @throws OSHDBException if cluster state is not active.
54
56
*/
55
- public OSHDBIgnite (OSHDBDatabase keytables ) {
57
+ public OSHDBIgnite (DataSource keytables ) {
56
58
this (new File ("ignite-config.xml" ), keytables );
57
59
}
58
60
@@ -62,7 +64,7 @@ public OSHDBIgnite(OSHDBDatabase keytables) {
62
64
* @param ignite Ignite instance to use.
63
65
* @throws OSHDBException if cluster state is not active.
64
66
*/
65
- public OSHDBIgnite (Ignite ignite , OSHDBDatabase keytables ) {
67
+ public OSHDBIgnite (Ignite ignite , DataSource keytables ) {
66
68
this (ignite , false , keytables );
67
69
}
68
70
@@ -72,7 +74,7 @@ public OSHDBIgnite(Ignite ignite, OSHDBDatabase keytables) {
72
74
* @param igniteConfigFilePath ignite configuration file
73
75
* @throws OSHDBException if cluster state is not active.
74
76
*/
75
- public OSHDBIgnite (String igniteConfigFilePath , OSHDBDatabase keytables ) {
77
+ public OSHDBIgnite (String igniteConfigFilePath , DataSource keytables ) {
76
78
this (new File (igniteConfigFilePath ), keytables );
77
79
}
78
80
@@ -82,14 +84,15 @@ public OSHDBIgnite(String igniteConfigFilePath, OSHDBDatabase keytables) {
82
84
* @param igniteConfig ignite configuration file
83
85
* @throws OSHDBException if cluster state is not active.
84
86
*/
85
- public OSHDBIgnite (File igniteConfig , OSHDBDatabase keytables ) {
87
+ public OSHDBIgnite (File igniteConfig , DataSource keytables ) {
86
88
this (startClient (igniteConfig ), true , keytables );
87
89
}
88
90
89
- public OSHDBIgnite (Ignite ignite , boolean owner , OSHDBDatabase keytables ) {
91
+ public OSHDBIgnite (Ignite ignite , boolean owner , DataSource keytables ) {
90
92
this .ignite = ignite ;
91
93
this .owner = owner ;
92
- this .keytables = keytables ;
94
+ this .tagTranslator = new JdbcTagTranslator (keytables );
95
+
93
96
checkStateActive ();
94
97
}
95
98
@@ -107,7 +110,7 @@ private void checkStateActive() {
107
110
108
111
@ Override
109
112
public TagTranslator getTagTranslator () {
110
- return keytables . getTagTranslator () ;
113
+ return tagTranslator ;
111
114
}
112
115
113
116
@ Override
0 commit comments