Skip to content
Snippets Groups Projects
Commit 7026c832 authored by Pavel Šeda's avatar Pavel Šeda
Browse files

Merge branch '105-change-missing-sandboxids-to-string' into 'develop'

Resolve "Change missing sandboxIds to string"

See merge request !117
parents 11f07153 a0f156c1
No related branches found
No related tags found
2 merge requests!119Develop,!117Resolve "Change missing sandboxIds to string"
Pipeline #209115 passed with stages
in 7 minutes and 15 seconds
......@@ -272,8 +272,8 @@ public class ExportImportFacade {
writeEventsByPhases(zos, run, events);
List<Map<String, Object>> consoleCommands = getConsoleCommands(trainingInstance, run);
Integer sandboxId = events.get(0).get("sandbox_id") == null ?
run.getParticipantRef().getUserRefId().intValue() : (Integer) events.get(0).get("sandbox_id");
String sandboxId = events.get(0).get("sandbox_id") == null ?
run.getParticipantRef().getUserRefId().toString() : (String) events.get(0).get("sandbox_id");
writeConsoleCommands(zos, sandboxId, consoleCommands);
writeConsoleCommandsDetails(zos, trainingInstance, run, sandboxId, phaseStartTimestampMapping);
}
......@@ -348,7 +348,7 @@ public class ExportImportFacade {
}
}
private void writeConsoleCommands(ZipOutputStream zos, Integer sandboxId, List<Map<String, Object>> consoleCommands) throws IOException {
private void writeConsoleCommands(ZipOutputStream zos, String sandboxId, List<Map<String, Object>> consoleCommands) throws IOException {
ZipEntry consoleCommandsEntry = new ZipEntry(LOGS_FOLDER + "/sandbox-" + sandboxId + "-useractions" + AbstractFileExtensions.JSON_FILE_EXTENSION);
zos.putNextEntry(consoleCommandsEntry);
for (Map<String, Object> command : consoleCommands) {
......@@ -357,7 +357,7 @@ public class ExportImportFacade {
}
}
private void writeConsoleCommandsDetails(ZipOutputStream zos, TrainingInstance instance, TrainingRun run, Integer sandboxId, Map<Integer, Long> phaseStartTimestampMapping) throws IOException {
private void writeConsoleCommandsDetails(ZipOutputStream zos, TrainingInstance instance, TrainingRun run, String sandboxId, Map<Integer, Long> phaseStartTimestampMapping) throws IOException {
List<Long> phaseTimestampRanges = new ArrayList<>(phaseStartTimestampMapping.values());
List<Integer> phaseIds = new ArrayList<>(phaseStartTimestampMapping.keySet());
phaseTimestampRanges.add(Long.MAX_VALUE);
......@@ -372,7 +372,7 @@ public class ExportImportFacade {
}
}
}
private List<Map<String, Object>> getConsoleCommandsWithinTimeRange(TrainingInstance instance, TrainingRun run, Integer sandboxId, Long from, Long to) {
private List<Map<String, Object>> getConsoleCommandsWithinTimeRange(TrainingInstance instance, TrainingRun run, String sandboxId, Long from, Long to) {
if(instance.isLocalEnvironment()) {
return elasticsearchServiceApi.findAllConsoleCommandsByAccessTokenAndUserIdAndTimeRange(instance.getAccessToken(), run.getParticipantRef().getUserRefId(), from, to);
}
......
......@@ -121,7 +121,7 @@ public class ElasticsearchServiceApi {
}
}
public List<Map<String, Object>> findAllConsoleCommandsBySandboxAndTimeRange(Integer sandboxId, Long from, Long to) {
public List<Map<String, Object>> findAllConsoleCommandsBySandboxAndTimeRange(String sandboxId, Long from, Long to) {
try {
return elasticsearchServiceWebClient
.get()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment