From: vasary.daniel Date: Thu, 21 Jan 2021 20:24:18 +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=3727c81c139621b9572765657f57d7aaf852b92a;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C32120 --- diff --git a/server/-configuration/mediacube.json b/server/-configuration/mediacube.json index 44fe9f45..3cb5e227 100644 --- a/server/-configuration/mediacube.json +++ b/server/-configuration/mediacube.json @@ -23,6 +23,11 @@ "color": "BROWN100", "icon": "ic_group_work_black_18dp.png" }, + { + "name": "DEMO nyers", + "color": "BROWN100", + "icon": "ic_group_work_black_18dp.png" + }, { "name": "Egyéb", "color": "YELLOW200", diff --git a/server/-configuration/run-mediacube-server-hirtv.launch b/server/-configuration/run-mediacube-server-hirtv.launch index e7017ca4..93820b4f 100644 --- a/server/-configuration/run-mediacube-server-hirtv.launch +++ b/server/-configuration/run-mediacube-server-hirtv.launch @@ -19,12 +19,12 @@ - + - + diff --git a/server/-configuration/run-mediacube-server-user (2).launch b/server/-configuration/run-mediacube-server-user (2).launch index b818cae9..c249daef 100644 --- a/server/-configuration/run-mediacube-server-user (2).launch +++ b/server/-configuration/run-mediacube-server-user (2).launch @@ -19,7 +19,7 @@ - + diff --git a/server/-configuration/run-mediacube-server-user.launch b/server/-configuration/run-mediacube-server-user.launch index 62004149..b7027372 100644 --- a/server/-configuration/run-mediacube-server-user.launch +++ b/server/-configuration/run-mediacube-server-user.launch @@ -19,7 +19,7 @@ - + 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 26e8dd0b..65aad988 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 @@ -1018,4 +1018,65 @@ public class SmallTests { System.out.println(sut.toString()); } + //htv errors + @Test + public void test9999() throws Exception { + Set tsm = new LinkedHashSet<>(Files.readAllLines(Paths.get("/opt/HTV/htv-tsm.txt"))); + Set mc = new LinkedHashSet<>(Files.readAllLines(Paths.get("/opt/HTV/htv-mc.txt"))); + + int errorCount = 0; + int current = 0; + + for (String mcfile : mc) { + current++; + boolean tsmContains = tsm.contains(mcfile); + if (!tsmContains) { + errorCount++; + int p = current * 100 / mc.size(); + System.out.println("Missing " + mcfile + " %" + p); + } + } + System.out.println("All missing: " + errorCount); + } + + //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/SelenioPool_16_9/"); + String tag = "SD_HIGH_16_9"; + + Set ids = new LinkedHashSet<>(); + try (DirectoryStream paths = Files.newDirectoryStream(source)) { + paths.forEach(path -> { + try { + List lines = Files.readAllLines(path); + lines.forEach(i -> ids.add(i.split(";")[1])); + } catch (IOException e) { + e.printStackTrace(); + } + }); + } + + Set mcids = new LinkedHashSet<>(); + List mc = Files.readAllLines(Paths.get("/opt/AMC/2021/ISSUES/#203/mediaprofile.log")); + mc.forEach(i -> { + if (i.contains(tag)) { + String id = i.replace(String.format(" is %s", tag), ""); + id = id.substring(id.lastIndexOf(" ") + 1); + mcids.add(id); + } + }); + + System.out.println("Processing"); + for (String id : ids) { + if (mcids.contains(id)) + continue; + System.out.println("Missing: " + id); + } + } + } diff --git a/server/user.jobengine.executors/config/config-mv.xml b/server/user.jobengine.executors/config/config-mv.xml index 8599ec6f..e0f67e2e 100644 --- a/server/user.jobengine.executors/config/config-mv.xml +++ b/server/user.jobengine.executors/config/config-mv.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/cancelable.xml b/server/user.jobengine.executors/jobtemplates/cancelable.xml index 2be289b3..c0accf91 100644 --- a/server/user.jobengine.executors/jobtemplates/cancelable.xml +++ b/server/user.jobengine.executors/jobtemplates/cancelable.xml @@ -4,6 +4,9 @@ + + + @@ -13,5 +16,12 @@ + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/cancelable.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/cancelable.xml index 2be289b3..15e21ce1 100644 --- a/server/user.jobengine.executors/jobtemplates/mediavivantis/cancelable.xml +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/cancelable.xml @@ -4,6 +4,9 @@ + + + @@ -12,6 +15,18 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/test-fork-cancelable.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/test-fork-cancelable.xml new file mode 100644 index 00000000..f3d21d6e --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/test-fork-cancelable.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/register-vod-restore.xml b/server/user.jobengine.executors/jobtemplates/register-vod-restore.xml index 6097d321..ac996108 100644 --- a/server/user.jobengine.executors/jobtemplates/register-vod-restore.xml +++ b/server/user.jobengine.executors/jobtemplates/register-vod-restore.xml @@ -2,12 +2,16 @@ + - + + + + diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/CancelableStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/CancelableStep.java index 14cfbd6f..b01bf0a2 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/CancelableStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/CancelableStep.java @@ -21,6 +21,11 @@ public class CancelableStep extends JobStep { // ftpTest(); + if (param == 0) + Thread.sleep(5000); + if (param == 1) + throw new Exception("Error teszt"); + Marker marker = MarkerManager.getMarker("MEDIAPROFILE"); for (int i = 0; i < count; i++) { @@ -35,7 +40,7 @@ public class CancelableStep extends JobStep { e.printStackTrace(); throw e; } - return null; + return new Object[] { param }; } void ftpTest() throws Exception { diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/CleanupMountedLocationStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/CleanupMountedLocationStep.java index 7fa3d092..4e6f10d1 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/CleanupMountedLocationStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/CleanupMountedLocationStep.java @@ -23,6 +23,10 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Marker; +import user.commons.RemoteFile; +import user.commons.StoreUri; +import user.commons.remotestore.RemoteStoreProtocol; +import user.jobengine.db.Store; import user.jobengine.server.IJobEngine; import user.jobengine.server.IJobRuntime; @@ -64,6 +68,7 @@ public class CleanupMountedLocationStep extends JobStep implements FileVisitor

killDateFiles) { Date killDate = null; @@ -79,7 +84,7 @@ public class CleanupMountedLocationStep extends JobStep implements FileVisitor

directoryStream = null; if (StringUtils.isBlank(sourcePath.toString())) { @@ -91,9 +96,19 @@ public class CleanupMountedLocationStep extends JobStep implements FileVisitor

() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { @@ -104,7 +119,7 @@ public class CleanupMountedLocationStep extends JobStep implements FileVisitor

{ + tsmName[0] = rs.getString("relativepath"); + return false; + }, null); + + if (tsmName[0] != null) { + try { + RemoteFile remoteFile = tsmStoreUri.getRemoteFile(tsmName[0]); + result = remoteFile != null; + } catch (Exception e) { + logger.error(e.getMessage()); + } finally { + tsmStoreUri.cleanUp(); + } + } + return result; + } + @Override public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { if (!dir.equals(sourcePath) && isEmpty(dir)) { @@ -188,6 +226,9 @@ public class CleanupMountedLocationStep extends JobStep implements FileVisitor

Adatbázis kontextus erőforrás kezelő. @@ -18,6 +22,19 @@ import sqlj.runtime.ref.DefaultContext; public class ContextPool extends ResourcePool { private static final Logger logger = LogManager.getLogger(); + public static DB getNoSQLDB() { + DB result = null; + try { + DataSource dataSource = MediaCubeDataSourceFactory.getNoSQLDatasource(); + Connection connection = dataSource.getConnection(); + result = NoSQLClient.getDB(connection); + } catch (Exception e) { + logger.error(e); + } + + return result; + } + public ContextPool(ConnectionPoolProperties properties) { super(properties); } @@ -71,26 +88,11 @@ public class ContextPool extends ResourcePool { @Override protected DefaultContext createObject() { - ConnectionPoolProperties cpp = (ConnectionPoolProperties) this.getProperties(); Connection connection = null; DefaultContext context = null; try { - Class.forName(cpp.getDriverName()); - } catch (ClassNotFoundException e) { - throw new PoolException(e.getMessage()); - } - - try { - DriverManager.setLoginTimeout(cpp.getTimeout()); - Properties p = new Properties(); - p.setProperty(ConnectionPoolProperties.USERNAME, cpp.getUserName()); - p.setProperty(ConnectionPoolProperties.PASSWORD, cpp.getPassword()); - p.setProperty(ConnectionPoolProperties.TRACELEVEL, cpp.getTraceLevel()); - p.setProperty(ConnectionPoolProperties.TRACEFILE, cpp.getTraceFile()); - p.setProperty(ConnectionPoolProperties.TRACEFILEAPPEND, cpp.getTraceFileAppend()); - - connection = DriverManager.getConnection(cpp.getUrl(), p); - connection.setAutoCommit(cpp.getAutoCommit()); + DataSource dataSource = MediaCubeDataSourceFactory.getNoSQLDatasource(); + connection = dataSource.getConnection(); context = new DefaultContext(connection); } catch (Throwable t) { logger.error("System can't create JDBC connection. Reason: " + t.getMessage()); @@ -103,6 +105,39 @@ public class ContextPool extends ResourcePool { return context; } + // @Override + // protected DefaultContext createObject() { + // ConnectionPoolProperties cpp = (ConnectionPoolProperties) this.getProperties(); + // Connection connection = null; + // DefaultContext context = null; + // try { + // Class.forName(cpp.getDriverName()); + // } catch (ClassNotFoundException e) { + // throw new PoolException(e.getMessage()); + // } + // + // try { + // DriverManager.setLoginTimeout(cpp.getTimeout()); + // Properties p = new Properties(); + // p.setProperty(ConnectionPoolProperties.USERNAME, cpp.getUserName()); + // p.setProperty(ConnectionPoolProperties.PASSWORD, cpp.getPassword()); + // p.setProperty(ConnectionPoolProperties.TRACELEVEL, cpp.getTraceLevel()); + // p.setProperty(ConnectionPoolProperties.TRACEFILE, cpp.getTraceFile()); + // p.setProperty(ConnectionPoolProperties.TRACEFILEAPPEND, cpp.getTraceFileAppend()); + // + // connection = DriverManager.getConnection(cpp.getUrl(), p); + // connection.setAutoCommit(cpp.getAutoCommit()); + // context = new DefaultContext(connection); + // } catch (Throwable t) { + // logger.error("System can't create JDBC connection. Reason: " + t.getMessage()); + // Throwable cause = t.getCause(); + // if (cause instanceof InvocationTargetException) { + // Throwable targetException = ((InvocationTargetException) cause).getTargetException(); + // logger.error(targetException.getMessage()); + // } + // } + // return context; + // } public void lendObject(DefaultContext context) { super.lendObject(context); } diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobRuntime.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobRuntime.java index 484970fb..d9ee5afa 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobRuntime.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobRuntime.java @@ -7,6 +7,7 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.sql.Timestamp; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -90,6 +91,7 @@ public class JobRuntime extends Job implements IJobRuntime { private int spawnOrder; private boolean cancelable = true; + private List finishedStates = Arrays.asList(JobStatus.FINISHED, JobStatus.CANCELED, JobStatus.SUSPENDED); public JobRuntime() { variables = null; @@ -317,16 +319,9 @@ public class JobRuntime extends Job implements IJobRuntime { if (childrenIDs.contains(child.getId())) { //logger.info("Child {} notification", child.getId()); - switch (event.getSignalType()) { - case UPDATE: - //TODO calculate progress - if (JobStatus.SUSPENDED.equals(child.getStatus())) - forkSempahore.release(); - break; - case DELETE: - removeSpanwChild(child.getId()); - break; - } + if (event.getSignalType() == SignalType.UPDATE) + if (finishedStates.contains(child.getStatus())) + removeSpanwChild(child.getId()); if (!getJobEngine().isRunning()) forkSempahore.release(); @@ -732,7 +727,7 @@ public class JobRuntime extends Job implements IJobRuntime { private Semaphore forkSempahore; private IJobChangedListener jobChangedListener; private List childrenIDs; - + * */ @Override diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobStepExecutor.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobStepExecutor.java index 0ded9362..c9fcbdf9 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobStepExecutor.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobStepExecutor.java @@ -289,6 +289,8 @@ public class JobStepExecutor implements IJobStepExecutor { private Class parseClassHierarchy(GroovyClassLoader cl, String root, String className) throws IOException { Path path = Paths.get(root, className); + + logger.info("Loading class {} from {}", className, path.toString()); Class result = null; if (!path.toFile().exists()) return result; @@ -296,9 +298,11 @@ public class JobStepExecutor implements IJobStepExecutor { for (String line : lines) { if (line.contains("extends")) { + String[] tokens = line.split("extends"); String parent = tokens[tokens.length - 1]; parent = parent.replace("{", "").trim(); + logger.info("Class {} needs parent class {}", className, parent); parseClassHierarchy(cl, root, parent); break; diff --git a/server/user.mediacube.gui/WEB-INF/zk.xml b/server/user.mediacube.gui/WEB-INF/zk.xml index f921ea3a..259b1935 100644 --- a/server/user.mediacube.gui/WEB-INF/zk.xml +++ b/server/user.mediacube.gui/WEB-INF/zk.xml @@ -40,18 +40,18 @@ https://www.zkoss.org/wiki/ZK_Configuration_Reference/zk.xml - - user.jobengine.zk.util.DesktopCleanupListener - - - user.jobengine.zk.util.SessionCleanupListener - + + + + + + - - user.jobengine.zk.util.LifeCycleListener - + + + diff --git a/server/user.mediacube.gui/pages/searchitems/filters.zul b/server/user.mediacube.gui/pages/searchitems/filters.zul index e751f76c..c6a109cb 100644 --- a/server/user.mediacube.gui/pages/searchitems/filters.zul +++ b/server/user.mediacube.gui/pages/searchitems/filters.zul @@ -70,24 +70,41 @@ + + + + + + + + + + + + + + + + + + + + - - - + + + - + - + - - + + - + - + diff --git a/server/user.mediacube.gui/resources/i3-label_hu.properties b/server/user.mediacube.gui/resources/i3-label_hu.properties index afba507e..b0e183c6 100644 --- a/server/user.mediacube.gui/resources/i3-label_hu.properties +++ b/server/user.mediacube.gui/resources/i3-label_hu.properties @@ -1,4 +1,4 @@ -version=2.6.8 +version=2.7.0 footer=2016-2020 © Copyright User Rendszerház Kft. login_info=Információ