Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ public static String zipString(String text) {
}

public static String unzipString(String zipString) {
byte[] decode = Base64.getDecoder().decode(zipString);
byte[] decode;
try {
decode = Base64.getDecoder().decode(zipString);
} catch (IllegalArgumentException e) {
LOG.warn("Failed to decode base64 string: {}", e.getMessage());
return null;
}
Inflater inflater = new Inflater();
inflater.setInput(decode);
byte[] bytes = new byte[256];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,11 @@ private void process(FlinkApplication application, @Nonnull CheckPoints.CheckPoi
if (CheckPointStatusEnum.COMPLETED == status) {
if (shouldStoreAsSavepoint(checkPointKey, checkPoint)) {
savepointedCache.put(checkPointKey.getSavePointId(), DEFAULT_FLAG_BYTE);
saveSavepoint(checkPoint, application.getId());
flinkAppHttpWatcher.cleanSavepoint(application);
try {
saveSavepoint(checkPoint, application.getId());
} finally {
flinkAppHttpWatcher.cleanSavepoint(application);
}
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ public void doSetVersion() {

public Map<String, String> convertFlinkYamlAsMap() {
String flinkYamlString = DeflaterUtils.unzipString(flinkConf);
if (flinkYamlString == null) {
return new java.util.HashMap<>();
}
if (isLegacyFlinkConf()) {
return FlinkConfigurationUtils.loadLegacyFlinkConf(flinkYamlString);
}
Expand Down Expand Up @@ -168,6 +171,9 @@ public String getVersionOfLast() {
public Properties getFlinkConfig() {
String flinkYamlString = DeflaterUtils.unzipString(flinkConf);
Properties flinkConfig = new Properties();
if (flinkYamlString == null) {
return flinkConfig;
}
Map<String, String> config = FlinkConfigurationUtils.loadLegacyFlinkConf(flinkYamlString);
flinkConfig.putAll(config);
return flinkConfig;
Expand Down
Loading