Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
b487fc832f
2 changed files with 6 additions and 13 deletions
|
|
@ -99,8 +99,6 @@ public class SignalRestService {
|
||||||
} else {
|
} else {
|
||||||
log.error("неизвестная ошибка при постановке пакета на мониторинг в официальный сервис сигналов: {}", response.getBody());
|
log.error("неизвестная ошибка при постановке пакета на мониторинг в официальный сервис сигналов: {}", response.getBody());
|
||||||
}
|
}
|
||||||
CTUtil.removeFile(path);
|
|
||||||
CTUtil.removeFile(path + ".gz");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ public final class XmlMergeCoordinator implements IPipeLineTerminator<PartFilePa
|
||||||
}
|
}
|
||||||
|
|
||||||
private void mergeBatch(List<PartFilePayload> inputs) throws Exception {
|
private void mergeBatch(List<PartFilePayload> inputs) throws Exception {
|
||||||
|
log.debug("Starting merge batch; size: {}", inputs.size());
|
||||||
Long packageId = inputs.stream().findFirst().get().getPackageId();
|
Long packageId = inputs.stream().findFirst().get().getPackageId();
|
||||||
String outName = "merged_" + packageId + ".xml";
|
String outName = "merged_" + packageId + ".xml";
|
||||||
if (out == null) {
|
if (out == null) {
|
||||||
|
|
@ -62,13 +63,15 @@ public final class XmlMergeCoordinator implements IPipeLineTerminator<PartFilePa
|
||||||
XMLStreamWriter w = xof.createXMLStreamWriter(os, encoding.name());
|
XMLStreamWriter w = xof.createXMLStreamWriter(os, encoding.name());
|
||||||
|
|
||||||
for (PartFilePayload in : inputs) {
|
for (PartFilePayload in : inputs) {
|
||||||
log.debug("Copy person to file {}", in.getPartPath());
|
log.debug("Copy person from file {}", in.getPartPath());
|
||||||
copyPersonsChildren(in.getPartPath(), w);
|
copyPersonsChildren(in.getPartPath(), w);
|
||||||
}
|
}
|
||||||
|
|
||||||
w.flush();
|
w.flush();
|
||||||
w.close();
|
w.close();
|
||||||
}
|
}
|
||||||
|
for (PartFilePayload p : inputs) Files.deleteIfExists(p.getPartPath());
|
||||||
|
inputs.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -144,14 +147,14 @@ public final class XmlMergeCoordinator implements IPipeLineTerminator<PartFilePa
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (p.isPoison()) {
|
if (p.isPoison()) {
|
||||||
merge(batch);
|
mergeBatch(batch);
|
||||||
done.complete(new SignalXmlFilePayload(out));
|
done.complete(new SignalXmlFilePayload(out));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
batch.add(p);
|
batch.add(p);
|
||||||
}
|
}
|
||||||
if (!batch.isEmpty()) {
|
if (!batch.isEmpty()) {
|
||||||
merge(batch);
|
mergeBatch(batch);
|
||||||
}
|
}
|
||||||
} catch (InterruptedException ie) {
|
} catch (InterruptedException ie) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
|
|
@ -161,12 +164,4 @@ public final class XmlMergeCoordinator implements IPipeLineTerminator<PartFilePa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void merge(List<PartFilePayload> inputs) throws Exception {
|
|
||||||
log.debug("Starting merge batch; size: {}", inputs.size());
|
|
||||||
mergeBatch(inputs);
|
|
||||||
//удаляем исходники после успешного мерджа
|
|
||||||
for (PartFilePayload p : inputs) Files.deleteIfExists(p.getPartPath());
|
|
||||||
inputs.clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue