Skip to content

Commit 2bc38dd

Browse files
authored
feat: execlude zookeeper for curator (#3899)
* Execlude zookeeper when using curator * Fix local build java
1 parent 208b4f9 commit 2bc38dd

5 files changed

Lines changed: 35 additions & 16 deletions

File tree

java/openmldb-batch/pom.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@
167167
</exclusion>
168168
</exclusions>
169169
</dependency>
170-
170+
<dependency>
171+
<groupId>org.apache.zookeeper</groupId>
172+
<artifactId>zookeeper</artifactId>
173+
<version>3.4.14</version>
174+
</dependency>
171175
<dependency>
172176
<groupId>org.apache.curator</groupId>
173177
<artifactId>curator-framework</artifactId>
@@ -182,6 +186,12 @@
182186
<groupId>org.apache.curator</groupId>
183187
<artifactId>curator-recipes</artifactId>
184188
<version>4.2.0</version>
189+
<exclusions>
190+
<exclusion>
191+
<groupId>org.apache.zookeeper</groupId>
192+
<artifactId>zookeeper</artifactId>
193+
</exclusion>
194+
</exclusions>
185195
</dependency>
186196

187197
<!-- OpenMLDB -->

java/openmldb-common/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040
<groupId>org.apache.curator</groupId>
4141
<artifactId>curator-recipes</artifactId>
4242
<version>4.2.0</version>
43+
<exclusions>
44+
<exclusion>
45+
<groupId>org.apache.zookeeper</groupId>
46+
<artifactId>zookeeper</artifactId>
47+
</exclusion>
48+
</exclusions>
4349
</dependency>
4450
<dependency>
4551
<groupId>org.testng</groupId>

java/openmldb-taskmanager/pom.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@
134134
<groupId>org.apache.curator</groupId>
135135
<artifactId>curator-recipes</artifactId>
136136
<version>4.2.0</version>
137+
<exclusions>
138+
<exclusion>
139+
<groupId>org.apache.zookeeper</groupId>
140+
<artifactId>zookeeper</artifactId>
141+
</exclusion>
142+
</exclusions>
137143
</dependency>
138144
<dependency>
139145
<groupId>org.projectlombok</groupId>
@@ -142,9 +148,6 @@
142148
<scope>provided</scope>
143149
</dependency>
144150

145-
146-
147-
148151
<!-- Kubernetes -->
149152
<dependency>
150153
<groupId>io.fabric8</groupId>

java/openmldb-taskmanager/src/main/java/com/_4paradigm/openmldb/taskmanager/server/JobResultSaver.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
*/
5454
@Slf4j
5555
public class JobResultSaver {
56-
private static final Log log = LogFactory.getLog(JobResultSaver.class);
56+
private static final Log logger = LogFactory.getLog(JobResultSaver.class);
5757

5858
// false: unused, true: using
5959
// 0: unused, 1: saving, 2: finished but still in use
@@ -92,8 +92,8 @@ public String genUniqueFileName() {
9292
public boolean saveFile(int resultId, String jsonData) {
9393
// No need to wait, cuz id status must have been changed by genResultId before.
9494
// It's a check.
95-
if (log.isDebugEnabled()) {
96-
log.debug("save result " + resultId + ", data " + jsonData);
95+
if (logger.isDebugEnabled()) {
96+
logger.debug("save result " + resultId + ", data " + jsonData);
9797
}
9898
int status = idStatus.get(resultId);
9999
if (status != 1) {
@@ -105,7 +105,7 @@ public boolean saveFile(int resultId, String jsonData) {
105105
idStatus.set(resultId, 2);
106106
idStatus.notifyAll();
107107
}
108-
log.info("saved all result of result " + resultId);
108+
logger.info("saved all result of result " + resultId);
109109
return true;
110110
}
111111
// save to <log path>/tmp_result/<result_id>/<unique file name>
@@ -114,7 +114,7 @@ public boolean saveFile(int resultId, String jsonData) {
114114
File saveP = new File(savePath);
115115
if (!saveP.exists()) {
116116
boolean res = saveP.mkdirs();
117-
log.info("create save path " + savePath + ", status " + res);
117+
logger.info("create save path " + savePath + ", status " + res);
118118
}
119119
}
120120
String fileFullPath = String.format("%s/%s", savePath, genUniqueFileName());
@@ -125,7 +125,7 @@ public boolean saveFile(int resultId, String jsonData) {
125125
+ fileFullPath);
126126
}
127127
} catch (IOException e) {
128-
log.error("create file failed, path " + fileFullPath, e);
128+
logger.error("create file failed, path " + fileFullPath, e);
129129
return false;
130130
}
131131

@@ -135,7 +135,7 @@ public boolean saveFile(int resultId, String jsonData) {
135135
} catch (IOException e) {
136136
// Write failed, we'll lost a part of result, but it's ok for show sync job
137137
// output. So we just log it, and response the http request.
138-
log.error("write result to file failed, path " + fileFullPath, e);
138+
logger.error("write result to file failed, path " + fileFullPath, e);
139139
return false;
140140
}
141141
return true;
@@ -151,7 +151,7 @@ public String readResult(int resultId, long timeoutMs) throws InterruptedExcepti
151151
}
152152
}
153153
if (idStatus.get(resultId) != 2) {
154-
log.warn("read result timeout, result saving may be still running, try read anyway, id " + resultId);
154+
logger.warn("read result timeout, result saving may be still running, try read anyway, id " + resultId);
155155
}
156156
String output = "";
157157
// all finished, read csv from savePath
@@ -163,7 +163,7 @@ public String readResult(int resultId, long timeoutMs) throws InterruptedExcepti
163163
output = printFilesTostr(savePath);
164164
FileUtils.forceDelete(saveP);
165165
} else {
166-
log.info("empty result for " + resultId + ", show empty string");
166+
logger.info("empty result for " + resultId + ", show empty string");
167167
}
168168
// reset id
169169
synchronized (idStatus) {
@@ -189,7 +189,7 @@ public String printFilesTostr(String fileDir) {
189189
}
190190
return stringWriter.toString();
191191
} catch (Exception e) {
192-
log.warn("read result met exception when read " + fileDir + ", " + e.getMessage());
192+
logger.warn("read result met exception when read " + fileDir + ", " + e.getMessage());
193193
e.printStackTrace();
194194
return "read met exception, check the taskmanager log";
195195
}
@@ -219,7 +219,7 @@ private void printFile(String file, StringWriter stringWriter, boolean printHead
219219
csvPrinter.printRecord(iter.next());
220220
}
221221
} catch (Exception e) {
222-
log.warn("error when print result file " + file + ", ignore it");
222+
logger.warn("error when print result file " + file + ", ignore it");
223223
e.printStackTrace();
224224
}
225225
}

java/openmldb-taskmanager/src/main/java/com/_4paradigm/openmldb/taskmanager/zk/RecoverableZooKeeper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class RecoverableZooKeeper {
6262
private final String quorumServers;
6363
private final int maxMultiSize; // unused now
6464

65-
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "DE_MIGHT_IGNORE", justification = "None. Its always been this way.")
65+
//@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "DE_MIGHT_IGNORE", justification = "None. Its always been this way.")
6666
public RecoverableZooKeeper(String quorumServers, int sessionTimeout, Watcher watcher) throws IOException {
6767
// TODO: Add support for zk 'chroot'; we don't add it to the quorumServers
6868
// String as we should.

0 commit comments

Comments
 (0)