From: Sweidan Omar Date: Fri, 10 Dec 2021 09:59:15 +0000 (+0000) Subject: git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube... X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=835a334cd1145170a99cbe376500cbf4f749f8ef;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C32533 --- diff --git a/server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SmallTests.java b/server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SmallTests.java index bf52e648..7fc4751c 100644 --- a/server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SmallTests.java +++ b/server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SmallTests.java @@ -162,7 +162,7 @@ public class SmallTests { System.out.println(x.compareTo(y)); - //A TreeSet novekvo sorrendben adja vissza, a korabbi datum lesz elol + // A TreeSet novekvo sorrendben adja vissza, a korabbi datum lesz elol Set sut = new TreeSet<>(); sut.add("2020.03.01_12:00:00"); @@ -252,7 +252,8 @@ public class SmallTests { Object[] inputs = { mediaCubeMedia, targetPath, targetNamePattern, successRecipient, killDateDays, localRetrievePath, globalRetrievePath, useNexioTarget, nexioAgency, nexioPort, nexioUserName, nexioPassword }; - // Object[] inputs = { null, null, null, null, 0, null, null, false, null, 0, null, null }; + // Object[] inputs = { null, null, null, null, 0, null, null, false, null, 0, + // null, null }; sut.run(null, null, inputs); } @@ -372,7 +373,8 @@ public class SmallTests { @Test public void test94() throws Exception { List uploads = Files.readAllLines(Paths.get("/opt/AMC/upload-errors.csv")); - //List downloads = Files.readAllLines(Paths.get("/opt/AMC/download-errors.csv")); + // List downloads = + // Files.readAllLines(Paths.get("/opt/AMC/download-errors.csv")); Map ups = new HashMap<>(); @@ -420,13 +422,13 @@ public class SmallTests { System.out.println(content); System.out.println("..."); - // if (countMatches > 1) { - // countMultiTouched++; - // } + // if (countMatches > 1) { + // countMultiTouched++; + // } } System.out.println(countTouched); - // System.out.println(countMultiTouched); + // System.out.println(countMultiTouched); } @Test @@ -472,7 +474,7 @@ public class SmallTests { int nexio = Integer.parseInt(clip[2]); if (mc > nexio) { errors.add(clipName); - // System.out.println("Added: " + clipName); + // System.out.println("Added: " + clipName); } } @@ -491,7 +493,8 @@ public class SmallTests { } } - //update mediafile set relativepath ='CCEM100023-14.mxf.part' where relativepath ='CCEM100023-14.mxf'; + // update mediafile set relativepath ='CCEM100023-14.mxf.part' where + // relativepath ='CCEM100023-14.mxf'; @Test public void test97() throws Exception { List lines = Files.readAllLines(Paths.get("/opt/ordered-errors-sql.txt")); @@ -504,7 +507,7 @@ public class SmallTests { Files.write(Paths.get("/opt/sql.txt"), out); } - //ffmpeg hls + // ffmpeg hls @Test public void test99() throws Exception { System.setProperty("jobengine.ffmpeg.location", "/Programs/ffmpeg/bin/ffmpeg.exe"); @@ -518,12 +521,12 @@ public class SmallTests { }); } - //mc tsm tartalom osszehasonlitas + // mc tsm tartalom osszehasonlitas @Test public void test990() throws Exception { List missing = new ArrayList<>(); - //pasatol/lekerdezes + // pasatol/lekerdezes List mcL = Files.readAllLines(Paths.get("/opt/AMC/mc.txt")); // List tsmL = Files.readAllLines(Paths.get("/opt/AMC/tsm.txt")); @@ -540,7 +543,7 @@ public class SmallTests { Files.write(Paths.get("/opt/AMC/missing.txt"), missing); } - //tsm-missing pasa tartalom osszehasonlitas + // tsm-missing pasa tartalom osszehasonlitas @Test public void test991() throws Exception { List mcmissing = new ArrayList<>(); @@ -557,7 +560,7 @@ public class SmallTests { Files.write(Paths.get("/opt/AMC/mcmissing.txt"), mcmissing); } - //nexio modification change + // nexio modification change @Test public void test992() throws Exception { Timestamp nexio = Timestamp.from(Instant.now().minus(2, ChronoUnit.HOURS)); @@ -569,10 +572,10 @@ public class SmallTests { System.out.println(DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(ldt)); } - //mv missing from tsm + // mv missing from tsm @Test public void test993() throws Exception { - //List missing = Files.readAllLines(Paths.get("/opt/mv-missing.txt")); + // List missing = Files.readAllLines(Paths.get("/opt/mv-missing.txt")); List missing = Files.readAllLines(Paths.get("/opt/mv-mc-all.txt")); String tsm = new String(Files.readAllBytes(Paths.get("/opt/mv-tsm.txt"))); String polc = new String(Files.readAllBytes(Paths.get("/opt/mv-polc.txt"))); @@ -612,8 +615,8 @@ public class SmallTests { fCount++; System.out.println(fileName + " " + fCount); - // if (rd.contains(onlyId)) - // inrd++; + // if (rd.contains(onlyId)) + // inrd++; if (fileName.startsWith("R")) { ad++; @@ -622,17 +625,17 @@ public class SmallTests { else if (fileName.startsWith("M")) { material++; } else { - //System.out.println(onlyId); + // System.out.println(onlyId); other++; } } System.out.println(String.format("TSM hiány %d, polcon van %d, omben van %d", fCount, pCount, oCount)); System.out.println(String.format("Egyéb %d, Reklám %d, Promó %d, Anyag %d, Adásban volt %d", other, ad, promo, material, inrd)); - // Files.write(Paths.get("/opt/AMC/mcmissing.txt"), mcmissing); + // Files.write(Paths.get("/opt/AMC/mcmissing.txt"), mcmissing); } - //archiveitem+tags + // archiveitem+tags @Test public void test994() throws Exception { ArchiveItem archiveItem = ArchiveItem.fromFile(Paths.get("/opt1/.STATUS/0409_2032_UJ_OVI_OVB_MIX.MXF.json")); @@ -647,7 +650,7 @@ public class SmallTests { } - //mv migracio report + // mv migracio report @Test public void test995() throws Exception { String tsm = new String(Files.readAllBytes(Paths.get("/opt/mv-tsm.txt"))); @@ -677,7 +680,7 @@ public class SmallTests { boolean tsmContains = tsm.contains(fileName); if (tsmContains) { archivedCount++; - //System.out.println("Skipping archived " + omFilePath); + // System.out.println("Skipping archived " + omFilePath); continue; } @@ -687,12 +690,13 @@ public class SmallTests { float archivePercent = archivedCount * 100 / omCount; System.out.println(String.format("Archiválandó %d, archivált %d, nem archivált %d, százalék %f", omCount, archivedCount, errorCount, archivePercent)); - // Files.write(Paths.get("/opt/AMC/mcmissing.txt"), mcmissing); + // Files.write(Paths.get("/opt/AMC/mcmissing.txt"), mcmissing); } - //mv mc-tsm kulonbseg report - //select relativepath from mediafile; - // dsmadmc -id=support -password=userkft1q2 -TABdelimited "select LL_NAME from backups where FILESPACE_NAME LIKE '%JOBENGINE%'" > /opt/mv-tsm.txt + // mv mc-tsm kulonbseg report + // select relativepath from mediafile; + // dsmadmc -id=support -password=userkft1q2 -TABdelimited "select LL_NAME from + // backups where FILESPACE_NAME LIKE '%JOBENGINE%'" > /opt/mv-tsm.txt @Test public void test996() throws Exception { String tsm = new String(Files.readAllBytes(Paths.get("/opt/mv-tsm.txt"))); @@ -702,12 +706,12 @@ public class SmallTests { int errorCount = 0; for (String fileName : mc) { - //TODO idezojelek eltavolitasa + // TODO idezojelek eltavolitasa int lastIndexOf = fileName.lastIndexOf("-"); if (lastIndexOf > -1) { String fileId = fileName.substring(0, lastIndexOf); if (exclude.contains(fileId)) { - //System.out.println("Excluded " + fileName); + // System.out.println("Excluded " + fileName); continue; } } @@ -724,7 +728,7 @@ public class SmallTests { Files.write(Paths.get("/opt/mc-drop.sql"), sb); } - //mv exclude size by ID + // mv exclude size by ID @Test public void test997() throws Exception { List om = Files.readAllLines(Paths.get("/opt/mv-omarchive-size.txt")); @@ -749,7 +753,7 @@ public class SmallTests { String fileId = (lastHyphen < 0) ? fileName : fileName.substring(0, lastHyphen); if (exclude.contains(fileId)) { out.add(omPath); - //System.out.println(omPath); + // System.out.println(omPath); omExcludeCount++; omExcludeSizeSum += omSize; } @@ -762,7 +766,7 @@ public class SmallTests { Files.write(Paths.get("/opt/mv-excluded-parlament-byid.txt"), out); } - //mv exclude size by name + // mv exclude size by name @Test public void test998() throws Exception { List om = Files.readAllLines(Paths.get("/opt/mv-omarchive-size.txt")); @@ -797,7 +801,7 @@ public class SmallTests { Files.write(Paths.get("/opt/mv-excluded-parlament-name.txt"), out); } - //lastminute + // lastminute @Test public void test999() throws Exception { List lastMinute = Files.readAllLines(Paths.get("/opt/mv-lastminute.txt")); @@ -820,20 +824,21 @@ public class SmallTests { } if (!tsm.contains(fileName)) { - //System.out.println("Missing " + fileName); + // System.out.println("Missing " + fileName); out.add(lastMinuteToken); count++; } } System.out.println("All " + count); - // String excludedReport = String.format("Kihagyva %d db, összméret %s", omExcludeCount, readableFileSize(omExcludeSizeSum)); - // System.out.println(excludedReport); + // String excludedReport = String.format("Kihagyva %d db, összméret %s", + // omExcludeCount, readableFileSize(omExcludeSizeSum)); + // System.out.println(excludedReport); // Files.write(Paths.get("/opt/mv-lastminute-missing.txt"), out); } - //migration report + // migration report @Test public void test9990() throws Exception { List mc = Files.readAllLines(Paths.get("/opt/mv-mc-houseid.txt")); @@ -845,7 +850,7 @@ public class SmallTests { int omcount = 0; for (String omToken : om) { if (omToken.indexOf("/") == omToken.lastIndexOf("/")) { - //System.out.println("Skipping " + omToken); + // System.out.println("Skipping " + omToken); continue; } @@ -854,14 +859,14 @@ public class SmallTests { if (lastIndexOf > -1) { String fileId = fileName.substring(0, lastIndexOf); if (exclude.contains(fileId)) { - //System.out.println("Excluded " + fileName); + // System.out.println("Excluded " + fileName); continue; } } omcount++; if (!mc.contains(fileName)) { - //System.out.println("Missing " + fileName); + // System.out.println("Missing " + fileName); out.add(omToken); count++; continue; @@ -869,8 +874,9 @@ public class SmallTests { } System.out.println( "All (no PTV) " + omcount + " missing " + count + " completed " + ((count * 100) / omcount) + "%"); - // String excludedReport = String.format("Kihagyva %d db, összméret %s", omExcludeCount, readableFileSize(omExcludeSizeSum)); - // System.out.println(excludedReport); + // String excludedReport = String.format("Kihagyva %d db, összméret %s", + // omExcludeCount, readableFileSize(omExcludeSizeSum)); + // System.out.println(excludedReport); // Files.write(Paths.get("/opt/mv-missing-noptv.txt"), out); } @@ -902,8 +908,10 @@ public class SmallTests { @Test public void test9994() throws Exception { - // List tsm = Files.readAllLines(Paths.get("/opt/AMC/tsm-archived-from0903.txt")); - // List mc = Files.readAllLines(Paths.get("/opt/AMC/mc-archive-modified-from0903.txt")); + // List tsm = + // Files.readAllLines(Paths.get("/opt/AMC/tsm-archived-from0903.txt")); + // List mc = + // Files.readAllLines(Paths.get("/opt/AMC/mc-archive-modified-from0903.txt")); LinkedHashSet tsm = new LinkedHashSet<>(Files.readAllLines(Paths.get("/opt/AMC/tsm-all-withdate.txt"))); LinkedHashSet mc = new LinkedHashSet<>(Files.readAllLines(Paths.get("/opt/AMC/mc-witharchived.txt"))); @@ -920,12 +928,13 @@ public class SmallTests { else return id; }).forEach(id1 -> { - //System.out.println(id1.toString()); + // System.out.println(id1.toString()); mcjob.add(id1.toString()); }); - // List mc = Files.readAllLines(Paths.get("/opt/AMC/mc-all-modified.txt")); + // List mc = + // Files.readAllLines(Paths.get("/opt/AMC/mc-all-modified.txt")); Map tsmmap = new HashMap<>(); for (String t : tsm) { String[] tokens = t.split("\t"); @@ -946,7 +955,7 @@ public class SmallTests { Map mcmap = new LinkedHashMap<>(); for (String m : mc) { - //System.out.println(m); + // System.out.println(m); String[] tokens = m.split(";"); String id = tokens[0]; @@ -1067,7 +1076,7 @@ public class SmallTests { System.out.println(sut.toString()); } - //htv errors + // htv errors @Test public void test9999() throws Exception { Set tsm = new LinkedHashSet<>(Files.readAllLines(Paths.get("/opt/HTV/htv-tsm.txt"))); @@ -1088,13 +1097,13 @@ public class SmallTests { System.out.println("All missing: " + errorCount); } - //amc format check + // amc format check @Test public void test99990() throws Exception { - // Path source = Paths.get("/opt/AMC/2021/ISSUES/#203/SD/"); - // String tag = "SD_MAIN_422"; - // Path source = Paths.get("/opt/AMC/2021/ISSUES/#203/HD/"); - // String tag = "HD"; + // Path source = Paths.get("/opt/AMC/2021/ISSUES/#203/SD/"); + // String tag = "SD_MAIN_422"; + // Path source = Paths.get("/opt/AMC/2021/ISSUES/#203/HD/"); + // String tag = "HD"; Path source = Paths.get("/opt/AMC/2021/ISSUES/#203/SelenioPool_16_9/"); String tag = "SD_HIGH_16_9"; @@ -1128,7 +1137,7 @@ public class SmallTests { } } - //amc get free space + // amc get free space @Test public void test99991() throws Exception { try { @@ -1161,10 +1170,10 @@ public class SmallTests { su.setUserName("dani"); su.setPassword("dani"); su.setRootPath("ftp-1/xxx"); - // FtpDirectoryLister lister = (FtpDirectoryLister) su.getLister(); - // FTPClient ftp = lister.connect(); - // System.out.println(ftp.changeWorkingDirectory("ftp-1")); - // System.out.println(ftp.changeWorkingDirectory("xxx")); + // FtpDirectoryLister lister = (FtpDirectoryLister) su.getLister(); + // FTPClient ftp = lister.connect(); + // System.out.println(ftp.changeWorkingDirectory("ftp-1")); + // System.out.println(ftp.changeWorkingDirectory("xxx")); List list = su.getRemoteFiles(); su.cleanUp(); @@ -1223,9 +1232,9 @@ public class SmallTests { "c:\\opt\\AMC\\2021\\ISSUES\\#203\\IPR000011027_169.mxf"); for (String file : files) { try (user.commons.mediaarea.MediaInfo mi = new user.commons.mediaarea.MediaInfo(file)) { - //Display aspect ratio - //Format profile - //String inform = mi.inform(); + // Display aspect ratio + // Format profile + // String inform = mi.inform(); System.out.println("---------------------------------------"); System.out.println(file); System.out.println(mi.get(StreamKind.Video, 0, "Width")); @@ -1306,9 +1315,12 @@ public class SmallTests { assertNotNull(settings); } - //AMC hianyzo hangsav hibakereses - //select finished,related from job where name='Archiválás' and finished is not null order by finished - //dsmadmc -id=support -password=userkft -TABdelimited -dataonly=yes "select backup_date ||','|| replace(replace(LL_NAME, '.mxf', ''),'/','') from backups where NODE_NAME='PASANODE' and state='ACTIVE_VERSION'" + // AMC hianyzo hangsav hibakereses + // select finished,related from job where name='Archiválás' and finished is not + // null order by finished + // dsmadmc -id=support -password=userkft -TABdelimited -dataonly=yes "select + // backup_date ||','|| replace(replace(LL_NAME, '.mxf', ''),'/','') from backups + // where NODE_NAME='PASANODE' and state='ACTIVE_VERSION'" @Test public void test999993() throws Exception { List jobs = Files.readAllLines(Paths.get("/opt/AMC/2021/TSM-ERROR/archive-jobs")); @@ -1325,7 +1337,7 @@ public class SmallTests { jobsMap.put(name, dt); else if (stored.before(dt)) jobsMap.put(name, dt); - // System.out.println(name); + // System.out.println(name); } List tsm = Files.readAllLines(Paths.get("/opt/AMC/2021/TSM-ERROR/archive-tsm")); @@ -1337,7 +1349,7 @@ public class SmallTests { Date dt = df1.parse(tokens[0]); String name = tokens[1].replace(".part", ""); tsmMap.put(name, dt); - //System.out.println(name); + // System.out.println(name); } System.out.println("NAME, TSM DATE, ARCHIVE DATE"); @@ -1368,7 +1380,7 @@ public class SmallTests { } } - //MediaCube client + // MediaCube client @Test public void test999994() throws Exception { MediaCubeClient mc = new MediaCubeClient("http://localhost:9080"); @@ -1424,8 +1436,8 @@ public class SmallTests { lastDir = lastDir.replace("X:", ""); lastDir = lastDir.replace("\\", "/"); lastDir = lastDir.trim(); - // if (!lastDir.endsWith(".STATUS")) - // System.out.println(">> " + lastDir); + // if (!lastDir.endsWith(".STATUS")) + // System.out.println(">> " + lastDir); } if (lastDir != null && lastDir.endsWith(".STATUS"))