From 684636825a218e934198a50e7c522cd0f1c09243 Mon Sep 17 00:00:00 2001 From: "vasary.daniel" Date: Fri, 4 Dec 2020 07:56:43 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C32087 --- server/-configuration/jetty-test.zip | Bin 0 -> 21398 bytes server/-configuration/log4j2.xml | 17 +- .../run-mediacube-server-mv.launch | 2 +- .../run-mediacube-server-user (1).launch | 2 +- .../run-mediacube-server-user (2).launch | 30 ++++ server/-configuration/scheduledjobs.json | 4 + server/-dependencies/jobengine.target | 3 +- .../mediacube/executors/tests/SmallTests.java | 29 +++- .../server/steps/PASAPOOLTransferToStep.java | 100 ++++++++---- .../config/config-mv.xml | 5 + .../mediavivantis/archive-limited.xml | 41 +++++ .../mediavivantis/archive-material.xml | 49 ++++++ .../mediavivantis/archive-ondemand.xml | 41 +++++ .../mediavivantis/batch-retrieve-ondemand.xml | 29 ++++ .../jobtemplates/mediavivantis/cancelable.xml | 17 ++ .../mediavivantis/common-copy.xml | 41 +++++ .../mediavivantis/create-lowres-ondemand.xml | 106 +++++++++++++ .../mediavivantis/delete-materials.xml | 17 ++ .../mediavivantis/fake-concurrent.xml | 26 +++ .../mediavivantis/fake-noparams.xml | 6 + .../jobtemplates/mediavivantis/fake-spawn.xml | 45 ++++++ .../jobtemplates/mediavivantis/fake.xml | 29 ++++ .../mediavivantis/migrate-hsm.xml | 21 +++ .../mediavivantis/retrieve-ondemand.xml | 150 ++++++++++++++++++ .../jobtemplates/mediavivantis/retrieve.xml | 21 +++ .../mediavivantis/sys-recreate-lowres.xml | 118 ++++++++++++++ .../server/steps/TSMSimpleRestoreStep.java | 54 +++++++ .../server/steps/CancelableStep.java | 7 +- .../server/steps/CreateMissingLowresStep.java | 2 +- .../server/steps/TestForkCancelableStep.java | 2 +- .../META-INF/MANIFEST.MF | 1 - .../src/user/commons/nosql/NoSQLUtils.java | 31 ++-- .../src/user/commons/octopus/OctopusAPI.java | 52 +++++- .../commons/remotestore/TSMOutputStream.java | 6 +- .../src/user/commons/pool/ContextPool.java | 58 ++++--- .../src/user/jobengine/server/JobEngine.java | 31 ++-- .../jobengine/server/JobStepExecutor.java | 23 ++- .../META-INF/MANIFEST.MF | 1 + .../osgi/mediacube/MediaCubeService.java | 113 ++++++++++++- .../user.mediacube.gui/pages/searchitems.zul | 2 +- .../user/jobengine/zk/model/SearchModel.java | 5 +- .../user/tsm/client/TSMBufferedClient.java | 27 ++-- 42 files changed, 1227 insertions(+), 137 deletions(-) create mode 100644 server/-configuration/jetty-test.zip create mode 100644 server/-configuration/run-mediacube-server-user (2).launch create mode 100644 server/user.jobengine.executors/config/config-mv.xml create mode 100644 server/user.jobengine.executors/jobtemplates/mediavivantis/archive-limited.xml create mode 100644 server/user.jobengine.executors/jobtemplates/mediavivantis/archive-material.xml create mode 100644 server/user.jobengine.executors/jobtemplates/mediavivantis/archive-ondemand.xml create mode 100644 server/user.jobengine.executors/jobtemplates/mediavivantis/batch-retrieve-ondemand.xml create mode 100644 server/user.jobengine.executors/jobtemplates/mediavivantis/cancelable.xml create mode 100644 server/user.jobengine.executors/jobtemplates/mediavivantis/common-copy.xml create mode 100644 server/user.jobengine.executors/jobtemplates/mediavivantis/create-lowres-ondemand.xml create mode 100644 server/user.jobengine.executors/jobtemplates/mediavivantis/delete-materials.xml create mode 100644 server/user.jobengine.executors/jobtemplates/mediavivantis/fake-concurrent.xml create mode 100644 server/user.jobengine.executors/jobtemplates/mediavivantis/fake-noparams.xml create mode 100644 server/user.jobengine.executors/jobtemplates/mediavivantis/fake-spawn.xml create mode 100644 server/user.jobengine.executors/jobtemplates/mediavivantis/fake.xml create mode 100644 server/user.jobengine.executors/jobtemplates/mediavivantis/migrate-hsm.xml create mode 100644 server/user.jobengine.executors/jobtemplates/mediavivantis/retrieve-ondemand.xml create mode 100644 server/user.jobengine.executors/jobtemplates/mediavivantis/retrieve.xml create mode 100644 server/user.jobengine.executors/jobtemplates/mediavivantis/sys-recreate-lowres.xml create mode 100644 server/user.jobengine.executors/mediavivantis/user/jobengine/server/steps/TSMSimpleRestoreStep.java rename server/user.jobengine.executors/{amc => src}/user/jobengine/server/steps/CancelableStep.java (86%) diff --git a/server/-configuration/jetty-test.zip b/server/-configuration/jetty-test.zip new file mode 100644 index 0000000000000000000000000000000000000000..25d7bc90dfc33e5a5256a8c1805c25e560696cc5 GIT binary patch literal 21398 zcmeF&V{~TGmN4o!wry5y+qP}nd1KqQZ9Azr729^jPAaSZd%GDOZPzUhWdFGaA#Oh_Ud-RQ@+{4)@yDaH z$4;gdO9JLbsHjPa;BbNI%Z7XU06uY*WK+ed46PBuJ%(q{%!wLx)D%1l46O5{mwCY_ z0|LR!zf2!oz3-QYsdC~xr!jggF86PLdLF6oC64ZO%l~-uF|3UqEg=!!lh(Cl9NoKg zJ!vC9$}t;`|9Y({LWDhJWbEU67A5c=LlT;^5{vJI>7Jq7FHE1Lq(P16`_QmN(+93Q2EFUZtOgeB2L&T>H2E?L zG!+v@a|m5mJn`=MTdXH==Cb*k>?-go_9C<%CN7N%>)N3$G%a}65(@i$DiR81q?2XY zHU}?J;Jmm@4311;A(R~g15=2vU@q!x0BZrSmG{_H6}EN3zLg!E-V6SX24`iO!r*ty zax{G&M3K$UGmjfVE?r|xQUmxZCGc?)-;;npY0eS1+X+#!!uB4-ZG6bW@?wml>`HQI zLL=cRuL@)?D!-7C5+>~tOsbcYpddQv`r79?;D0>_MfPFE39GuCq|s9STDwFP76&Px6f&X3JjQ+Q+#l!- z*O%7@IHtj{F5?XY+rgdFlnKOqR?p?d_8#4M@KjSoW=(mkeW3oj470cL*~K<;yZ`VBi%_6ZkX@QG{73*)3IA+*Yp$p)(v|KgEo zp*s<#cO_3v$4;ii9OPU<2iI9bO>dLN$if@}wN0rLu+G;D;Q_oqWt{)A+|CIvBwTTw z_?j)cOT9qKrs2%f4^&DTKWZHJjI54iB>l^YCgY4xg!wnT3^Mo8QdNoD@`^~}1xxaC zg?Wwdx$ge!m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O)b?wfZXbBeUbjJBBVB%;+|HZd^tH`>vL8HsGJ}8L+0Nt$p0B58t@>%F%l2^X z-+Mgri&lg^nzo}+Pj>ASgNRclR$mqRM81EKs`AxMX3YNZT<%}Z1?{}aTh}tZ|MYvs zquUQZxpVK&E4+QBVc|)qSvofTxl1DU)vvI>bs+c_``%N{zS+0+mLA!(YfIH}foogq zKAfq}+*WNaTDnBuckTO9r^Qhs7@ zrZVl~o!P72=eIBJD~Nafx`SQbe@%USS<8+5#qZYf+}&U2@Z{iC=4ttfvqSDpo!%(<1clNYL#wtw&S=9A*u*ndAKoVYzDf9}gY zzDX}noez~h7hl$5Q+r~~x8mmc{|o<=)UVf0{%!f+?q5v*?;Er4_CCGU9^21j+v&bk zyWZ7HUM~7`xpKtWt2fPhmL1U2Fqm}2-fm8={(<28;(i~+^}^?0_Dg6z-+b>a>&?}( z?Om6s?r2TS43w3scpB|?Q##Y;!OB_Ff4s_+Uh%ME^(2W4H!Ett#9y5M`r!V|EvY*r z0v}w|yCKCWdVZE_sPZIt_M7+Tx6S|09pKH#B*K9EL^}u&fYPw@?QrV>op1*MAU&v) z_6WPMpLhoXj0_443=BRfb2RYt@6ZiEKLQ5=KnB!szz*XB9kd5K5C>U5woUE`{kH^= z^`mTgM>hn08yg5fd|@kzY6xso8@dVTd(aRj9KvD(Vn-UfIq3V#5a#GfVYmcyw;8%| z==;DR02I1cQH(>{6^3pE`Z8~Xi!7CqU4*ps6M4}$vT@kfjv|aRR>xr+#!6CTGqEjc zLzwwN3y+zg*+OKauq{hM7*(!|$0+b3C3LgUm%bp(ir2?s7TQ7>WD~KiOhA|@WQ5y9 ybbn%-O+}cr!W6qn=%!#BVMUm7%NE%b)bZ8;Z&uJjn+$>sf(#p27#J@2fp`F&4<7#j literal 0 HcmV?d00001 diff --git a/server/-configuration/log4j2.xml b/server/-configuration/log4j2.xml index 0d07d26f..c83c6774 100644 --- a/server/-configuration/log4j2.xml +++ b/server/-configuration/log4j2.xml @@ -1,10 +1,10 @@ - log/mediacube.log - log/$${date:yyyy-MM}/mediacube-%d{MM-dd-yyyy}-%i.log.gz - log/mediacube-err.log - log/$${date:yyyy-MM}/mediacube-err-%d{MM-dd-yyyy}-%i.log.gz + /opt/log/mediacube.log + /opt/log/$${date:yyyy-MM}/mediacube-%d{MM-dd-yyyy}-%i.log.gz + /opt/log/mediacube-err.log + /opt/log/$${date:yyyy-MM}/mediacube-err-%d{MM-dd-yyyy}-%i.log.gz @@ -13,6 +13,14 @@ + + + + + + + + @@ -57,6 +65,7 @@ + diff --git a/server/-configuration/run-mediacube-server-mv.launch b/server/-configuration/run-mediacube-server-mv.launch index 598c1d71..dd2d677b 100644 --- a/server/-configuration/run-mediacube-server-mv.launch +++ b/server/-configuration/run-mediacube-server-mv.launch @@ -19,7 +19,7 @@ - + diff --git a/server/-configuration/run-mediacube-server-user (1).launch b/server/-configuration/run-mediacube-server-user (1).launch index 2099db01..eeebbda6 100644 --- a/server/-configuration/run-mediacube-server-user (1).launch +++ b/server/-configuration/run-mediacube-server-user (1).launch @@ -22,7 +22,7 @@ - + diff --git a/server/-configuration/run-mediacube-server-user (2).launch b/server/-configuration/run-mediacube-server-user (2).launch new file mode 100644 index 00000000..b818cae9 --- /dev/null +++ b/server/-configuration/run-mediacube-server-user (2).launch @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/scheduledjobs.json b/server/-configuration/scheduledjobs.json index 8a4caaa7..d429ad34 100644 --- a/server/-configuration/scheduledjobs.json +++ b/server/-configuration/scheduledjobs.json @@ -13,6 +13,10 @@ "parameters": [ {"name": "itemID", "value": 1, "type": "java.lang.Long"} ] }, { + "template": "cancelable.xml", + "parameters": [ {"name": "param", "value": 1, "type": "java.lang.Integer"} ] + }, + { "active": false, "executeimmediate": false, "cronexpression": "0/10 * * * * ? *", diff --git a/server/-dependencies/jobengine.target b/server/-dependencies/jobengine.target index c133865f..5b106430 100644 --- a/server/-dependencies/jobengine.target +++ b/server/-dependencies/jobengine.target @@ -1,5 +1,5 @@ - + @@ -51,6 +51,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 1f524f2f..6fb7c300 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 @@ -31,8 +31,6 @@ import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; -import javax.sql.DataSource; - import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang.StringUtils; import org.apache.ibatis.jdbc.SQL; @@ -41,7 +39,7 @@ import org.junit.Test; import com.ibm.nosql.json.api.BasicDBList; import com.ibm.nosql.json.api.BasicDBObject; -import user.commons.MediaCubeDataSourceFactory; +import groovy.lang.GroovyClassLoader; import user.jobengine.db.Media; import user.jobengine.server.steps.ArchiveItem; import user.jobengine.server.steps.EscortFiles; @@ -934,8 +932,29 @@ public class SmallTests { @Test public void test9995() throws Exception { - MediaCubeDataSourceFactory.create(); - DataSource dataSource = MediaCubeDataSourceFactory.getDataSource(); + String className = "TestStep1"; + String root = "/opt/steps"; + try (GroovyClassLoader cl = new GroovyClassLoader(this.getClass().getClassLoader())) { + List lines = Files.readAllLines(Paths.get(root, className + ".java")); + String packageName = null; + for (String line : lines) { + String trimedLine = line.trim(); + if (trimedLine.startsWith("package")) { + packageName = trimedLine.replace("package", "").replace(";", "."); + } + + if (packageName != null && trimedLine.startsWith("import") && trimedLine.contains(packageName)) { + System.out.println(trimedLine); + } + } + + // Class myClass = cl.parseClass(Paths.get("/opt/steps/TestStep1.java").toFile()); + // System.out.println(myClass.getCanonicalName()); + // Method method = myClass.getMethod("execute"); + // method.invoke(myClass.newInstance()); + } catch (Exception e) { + throw e; + } } } diff --git a/server/user.jobengine.executors/amc/user/jobengine/server/steps/PASAPOOLTransferToStep.java b/server/user.jobengine.executors/amc/user/jobengine/server/steps/PASAPOOLTransferToStep.java index cd505402..f404fcf1 100644 --- a/server/user.jobengine.executors/amc/user/jobengine/server/steps/PASAPOOLTransferToStep.java +++ b/server/user.jobengine.executors/amc/user/jobengine/server/steps/PASAPOOLTransferToStep.java @@ -5,6 +5,8 @@ import java.nio.file.Paths; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; import user.commons.StoreUri; import user.commons.mediatool.MediaInfo; @@ -23,42 +25,43 @@ public class PASAPOOLTransferToStep extends TransferStep { public Object[] execute(StoreUri sourceStoreUri, String sourceFileName, StoreUri targetStoreUri, String targetFileName) throws Exception { this.sourceStoreUri = sourceStoreUri; this.sourceFileName = sourceFileName; + logMediaProfile(); return super.execute(sourceStoreUri, sourceFileName, targetStoreUri, targetFileName); } - @Override - protected StoreUri getTargetStoreUri() { - StoreUri result = null; - try { - Path filePath = Paths.get(sourceStoreUri.toString(true), sourceFileName); - MediaInfo mi = new MediaInfo(filePath); - mi.process(); - - if (isHD(mi)) { - result = getManager().getStoreUri("PEABLEBEACH", targetStoreUri.getProtocol()); - return result; - } - - if (isSD_HIGH_16_9(mi)) { - result = getManager().getStoreUri("SELENIOPOOL_16_9", targetStoreUri.getProtocol()); - return result; - } - - if (isSD_HIGH_4_3(mi)) { - result = getManager().getStoreUri("SELENIOPOOL_4_3", targetStoreUri.getProtocol()); - return result; - } - - if (isSD_MAIN_422(mi)) { - result = getManager().getStoreUri("PEABLEBEACH", targetStoreUri.getProtocol()); - return result; - } - } catch (Exception e) { - logger.error(getSessionMarker(), e.getMessage()); - result = targetStoreUri; - } - return result; - } + // @Override + // protected StoreUri getTargetStoreUri() { + // StoreUri result = null; + // try { + // Path filePath = Paths.get(sourceStoreUri.toString(true), sourceFileName); + // MediaInfo mi = new MediaInfo(filePath); + // mi.process(); + // + // if (isHD(mi)) { + // result = getManager().getStoreUri("PEABLEBEACH", targetStoreUri.getProtocol()); + // return result; + // } + // + // if (isSD_HIGH_16_9(mi)) { + // result = getManager().getStoreUri("SELENIOPOOL_16_9", targetStoreUri.getProtocol()); + // return result; + // } + // + // if (isSD_HIGH_4_3(mi)) { + // result = getManager().getStoreUri("SELENIOPOOL_4_3", targetStoreUri.getProtocol()); + // return result; + // } + // + // if (isSD_MAIN_422(mi)) { + // result = getManager().getStoreUri("PEABLEBEACH", targetStoreUri.getProtocol()); + // return result; + // } + // } catch (Exception e) { + // logger.error(getSessionMarker(), e.getMessage()); + // result = targetStoreUri; + // } + // return result; + // } // HD // height = 1080 @@ -93,4 +96,35 @@ public class PASAPOOLTransferToStep extends TransferStep { return mi.getHeight() < 650 && (CODEC_PROFILE_HIGH.equals(mi.getCodecProfileName()) || CODEC_PROFILE_422.equals(mi.getCodecProfileName())); } + protected void logMediaProfile() { + Marker marker = MarkerManager.getMarker("MEDIAPROFILE"); + try { + Path filePath = Paths.get(sourceStoreUri.toString(true), sourceFileName); + MediaInfo mi = new MediaInfo(filePath); + mi.process(); + + if (isHD(mi)) { + logger.info(marker, "%s is HD", sourceFileName); + return; + } + + if (isSD_HIGH_16_9(mi)) { + logger.info(marker, "%s is SD_HIGH_16_9", sourceFileName); + return; + } + + if (isSD_HIGH_4_3(mi)) { + logger.info(marker, "%s is SD_HIGH_4_3", sourceFileName); + return; + } + + if (isSD_MAIN_422(mi)) { + logger.info(marker, "%s is SD_MAIN_422", sourceFileName); + return; + } + } catch (Exception e) { + logger.error(marker, e.getMessage()); + } + } + } diff --git a/server/user.jobengine.executors/config/config-mv.xml b/server/user.jobengine.executors/config/config-mv.xml new file mode 100644 index 00000000..8599ec6f --- /dev/null +++ b/server/user.jobengine.executors/config/config-mv.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/archive-limited.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/archive-limited.xml new file mode 100644 index 00000000..8353b0c6 --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/archive-limited.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/archive-material.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/archive-material.xml new file mode 100644 index 00000000..d2fe5e93 --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/archive-material.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/archive-ondemand.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/archive-ondemand.xml new file mode 100644 index 00000000..9ef32997 --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/archive-ondemand.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/batch-retrieve-ondemand.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/batch-retrieve-ondemand.xml new file mode 100644 index 00000000..c1170b02 --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/batch-retrieve-ondemand.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 new file mode 100644 index 00000000..2be289b3 --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/cancelable.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/common-copy.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/common-copy.xml new file mode 100644 index 00000000..52c5b3f7 --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/common-copy.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/create-lowres-ondemand.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/create-lowres-ondemand.xml new file mode 100644 index 00000000..db6e88ff --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/create-lowres-ondemand.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/delete-materials.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/delete-materials.xml new file mode 100644 index 00000000..29a18e00 --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/delete-materials.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/fake-concurrent.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/fake-concurrent.xml new file mode 100644 index 00000000..88995ffb --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/fake-concurrent.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/fake-noparams.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/fake-noparams.xml new file mode 100644 index 00000000..a118f43f --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/fake-noparams.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/fake-spawn.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/fake-spawn.xml new file mode 100644 index 00000000..4a7fb850 --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/fake-spawn.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/fake.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/fake.xml new file mode 100644 index 00000000..1eb2ea44 --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/fake.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/migrate-hsm.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/migrate-hsm.xml new file mode 100644 index 00000000..650f125d --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/migrate-hsm.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/retrieve-ondemand.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/retrieve-ondemand.xml new file mode 100644 index 00000000..f42cde97 --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/retrieve-ondemand.xml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/retrieve.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/retrieve.xml new file mode 100644 index 00000000..d8ffd62f --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/retrieve.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/mediavivantis/sys-recreate-lowres.xml b/server/user.jobengine.executors/jobtemplates/mediavivantis/sys-recreate-lowres.xml new file mode 100644 index 00000000..92c90084 --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/mediavivantis/sys-recreate-lowres.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/mediavivantis/user/jobengine/server/steps/TSMSimpleRestoreStep.java b/server/user.jobengine.executors/mediavivantis/user/jobengine/server/steps/TSMSimpleRestoreStep.java new file mode 100644 index 00000000..f8c2eebc --- /dev/null +++ b/server/user.jobengine.executors/mediavivantis/user/jobengine/server/steps/TSMSimpleRestoreStep.java @@ -0,0 +1,54 @@ +package user.jobengine.server.steps; + +import java.nio.file.Files; +import java.nio.file.Paths; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.StoreUri; +import user.commons.remotestore.IProgressEventListener; +import user.commons.remotestore.IStatusEventListener; +import user.commons.remotestore.ProgressEvent; +import user.commons.remotestore.RemoteStoreProtocol; +import user.commons.remotestore.StatusEvent; +import user.jobengine.db.Media; +import user.jobengine.db.MediaFile; +import user.jobengine.db.Store; + +public class TSMSimpleRestoreStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute(long mediaId, String targetPath) throws Exception { + String fileName = null; + try { + Media media = getManager().getMedia(mediaId); + MediaFile mediaFile = getManager().getSystemMediaFile(media); + fileName = mediaFile.getRelativePath(); + getJobRuntime().setDescription(String.format("%s (%d frames)", fileName, media.getLength())); + Store tsmStore = getManager().getSystemStore(false); + StoreUri sourceStoreUri = getManager().getStoreUri(tsmStore.getName(), RemoteStoreProtocol.TSM); + sourceStoreUri.addProgressListener(new IProgressEventListener() { + @Override + public void progressChanged(ProgressEvent evt) { + setProgress(evt.getProgress()); + } + }); + sourceStoreUri.addStatusListener(new IStatusEventListener() { + @Override + public void statusChanged(StatusEvent evt) { + evt.setCancel(!canContinue()); + } + }); + StoreUri targetStoreUri = getManager().createStoreUri(RemoteStoreProtocol.LOCAL, targetPath); + sourceStoreUri.transferFrom(targetStoreUri, fileName, fileName + ".part"); + Files.move(Paths.get(targetPath, fileName + ".part"), Paths.get(targetPath, fileName)); + } catch (Exception e) { + logger.error("Az '{}' állomány visszatöltése sikertelen. A rendszer üzenete: {}", fileName, e.getMessage()); + throw e; + } + + return null; + } +} diff --git a/server/user.jobengine.executors/amc/user/jobengine/server/steps/CancelableStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/CancelableStep.java similarity index 86% rename from server/user.jobengine.executors/amc/user/jobengine/server/steps/CancelableStep.java rename to server/user.jobengine.executors/src/user/jobengine/server/steps/CancelableStep.java index 6648866f..bcf29f2c 100644 --- a/server/user.jobengine.executors/amc/user/jobengine/server/steps/CancelableStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/CancelableStep.java @@ -3,6 +3,8 @@ package user.jobengine.server.steps; import org.apache.commons.net.ftp.FTPClient; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; import user.commons.StoreUri; import user.commons.remotestore.FtpDirectoryLister; @@ -19,14 +21,15 @@ public class CancelableStep extends JobStep { // ftpTest(); + Marker marker = MarkerManager.getMarker("MEDIAPROFILE"); + for (int i = 0; i < count; i++) { if (getJobRuntime().isWaitingCancel()) break; Thread.sleep(500); int progress = (i + 1) * 100 / count; setProgress(progress); - if (i == 1) - throw new Exception("xxx"); + logger.info(marker, "{}", i); } } catch (Exception e) { e.printStackTrace(); diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/CreateMissingLowresStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/CreateMissingLowresStep.java index 832b4df8..0128e099 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/CreateMissingLowresStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/CreateMissingLowresStep.java @@ -58,7 +58,7 @@ public class CreateMissingLowresStep extends JobStep { private Media getFirstUntranscodedMedia(IItemManager manager, DBCollection collection) { Media[] result = { null }; - String query = "SELECT mediaid FROM VW_MISSING_PROXY_IDS WHERE LCASE(HOUSEID) LIKE '%.mxf' OR LCASE(HOUSEID) LIKE '%.mov' ORDER BY modified DESC FETCH FIRST ROW ONLY"; + String query = "SELECT mediaid FROM VW_MISSING_PROXY_IDS WHERE HOUSEID like 'M%' or HOUSEID like 'P%' or HOUSEID like 'R%' ORDER BY modified DESC FETCH FIRST ROW ONLY"; manager.executeQuery(query, rs -> { try { long mediaId = rs.getLong(1); diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/TestForkCancelableStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/TestForkCancelableStep.java index 39e39270..91d00a8d 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/TestForkCancelableStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/TestForkCancelableStep.java @@ -14,7 +14,7 @@ public class TestForkCancelableStep extends JobStep { // private static final String CHILD_TEMPLATE = "fake-concurrent.xml"; private static final String CHILD_TEMPLATE = "cancelable.xml"; private static final Logger logger = LogManager.getLogger(); - int count = 20; + int count = 5; @StepEntry public Object[] execute(IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { diff --git a/server/user.jobengine.osgi.commons/META-INF/MANIFEST.MF b/server/user.jobengine.osgi.commons/META-INF/MANIFEST.MF index 2c39e4bf..fb7783e4 100644 --- a/server/user.jobengine.osgi.commons/META-INF/MANIFEST.MF +++ b/server/user.jobengine.osgi.commons/META-INF/MANIFEST.MF @@ -55,7 +55,6 @@ Require-Bundle: org.apache.commons.lang;bundle-version="2.4.0", joda-time;bundle-version="2.2.0", javax.ws.rs-api;bundle-version="2.0.1", com.microsoft.sqlserver.sqljdbc;bundle-version="6.0.8112", - javax.annotation-api;bundle-version="1.2.0", org.apache.httpcomponents.httpclient;bundle-version="4.2.6", org.apache.httpcomponents.httpcore;bundle-version="4.2.5", org.apache.commons.logging;bundle-version="1.1.1", diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nosql/NoSQLUtils.java b/server/user.jobengine.osgi.commons/src/user/commons/nosql/NoSQLUtils.java index bbcd9d86..95f05ce8 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/nosql/NoSQLUtils.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/nosql/NoSQLUtils.java @@ -1,9 +1,12 @@ package user.commons.nosql; +import java.sql.Connection; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import javax.sql.DataSource; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -15,15 +18,10 @@ import com.ibm.nosql.json.api.DBCursor; import com.ibm.nosql.json.api.DBObject; import com.ibm.nosql.json.api.NoSQLClient; +import user.commons.MediaCubeDataSourceFactory; + public class NoSQLUtils { private static final Logger logger = LogManager.getLogger(); - public static final String Url, User, Pass; - public static DB noSQLClient = null; - static { - Url = System.getProperty("jobengine.nosql.db.url"); - User = System.getProperty("jobengine.nosql.db.user"); - Pass = System.getProperty("jobengine.nosql.db.password"); - } public static void addLong(BasicDBObject obj, String name, long value) { long current = asLong(obj, name); @@ -139,14 +137,15 @@ public class NoSQLUtils { } public static DB getNoSQLDB() { - // try { - // // if (noSQLClient == null) - // noSQLClient = NoSQLClient.getDB(NoSQLUtils.Url, NoSQLUtils.User, NoSQLUtils.Pass); - // } catch (Exception e) { - // logger.catching(e); - // } - // return noSQLClient; - - return NoSQLClient.getDB(NoSQLUtils.Url, NoSQLUtils.User, NoSQLUtils.Pass); + DB result = null; + try { + DataSource dataSource = MediaCubeDataSourceFactory.getNoSQLDatasource(); + Connection connection = dataSource.getConnection(); + result = NoSQLClient.getDB(connection); + } catch (Exception e) { + logger.error(e); + } + + return result; } } diff --git a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java index cefb2483..9183daa5 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java @@ -23,7 +23,7 @@ public class OctopusAPI implements IOctopusAPI { private DB db; public OctopusAPI() throws SQLException { - db = NoSQLUtils.getNoSQLDB(); + } private void addReferences(List result) { @@ -42,6 +42,11 @@ public class OctopusAPI implements IOctopusAPI { } } + private void ensureDB() { + if (db == null) + db = NoSQLUtils.getNoSQLDB(); + } + private List getReferencedObjects(List stories, String referenceCollectionName, String referenceField) { List ids = null; for (DBObject story : stories) { @@ -62,6 +67,7 @@ public class OctopusAPI implements IOctopusAPI { if (ids == null) return null; List result = null; + ensureDB(); DBCollection rundownCollection = db.getCollection(referenceCollectionName); BasicDBObject query = (BasicDBObject) QueryBuilder.start().put(ID).in(ids).get(); DBCursor findParents = rundownCollection.find(query); @@ -74,6 +80,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public DBObject getRundown(Date scheduledDate) { DBObject result = null; + ensureDB(); DBCollection collection = db.getCollection(RUNDOWN_COLLECTION); DBCursor find = collection.find(new BasicDBObject(SCHEDULED_START, scheduledDate)); if (find.hasNext()) @@ -84,6 +91,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public DBObject getRundownByID(long rundownID) { DBObject result = null; + ensureDB(); DBCollection collection = db.getCollection(RUNDOWN_COLLECTION); DBCursor find = collection.find(new BasicDBObject(ID, rundownID)); if (find.hasNext()) @@ -126,8 +134,13 @@ public class OctopusAPI implements IOctopusAPI { @Override public String getRundownContent(long id) { - BasicDBObject fields = new BasicDBObject(ID, 1).append(PARENT_STORY_ID, 1).append(NAME, 1).append(MODIFIED, 1).append(REF_RUNDOWN, 1).append(FORMAT, 1) - .append(MOS_OBJECTS, 1).append(SCRIPT_CONTENT, 1); + BasicDBObject fields = new BasicDBObject(ID, 1).append(PARENT_STORY_ID, 1) + .append(NAME, 1) + .append(MODIFIED, 1) + .append(REF_RUNDOWN, 1) + .append(FORMAT, 1) + .append(MOS_OBJECTS, 1) + .append(SCRIPT_CONTENT, 1); List stories = getRundownStories(id, fields); return getRundownContent(stories); } @@ -135,6 +148,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getRundownFullStories(long id) { List result = null; + ensureDB(); DBCollection collection = db.getCollection(STORY_COLLECTION); DBCursor find = collection.find(new BasicDBObject(REF_RUNDOWN, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, id)))) .sort(new BasicDBObject("name", 1)); @@ -161,6 +175,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getRundowns(Date scheduledDate) { List result = null; + ensureDB(); DBCollection collection = db.getCollection(RUNDOWN_COLLECTION); Calendar calStart = CalendarUtils.createZeroCalendar(scheduledDate); Calendar calStop = CalendarUtils.createZeroCalendar(scheduledDate); @@ -184,6 +199,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getRundownsByParentStoryID(String id) { + ensureDB(); DBCollection storyCollection = db.getCollection(STORY_COLLECTION); DBCursor find = storyCollection.find(new BasicDBObject(PARENT_STORY_ID, id), new BasicDBObject(REF_RUNDOWN, 1)); if (!find.hasNext()) @@ -194,6 +210,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getRundownsByPlaceHolderID(String id) { //db.testStoryCollection.find({"mosObjects": {$elemMatch: {"globalId": "OCTOPUS-ECHOTV-2429902"}}}) + ensureDB(); DBCollection storyCollection = db.getCollection(STORY_COLLECTION); BasicDBObject criteria = new BasicDBObject(MOS_OBJECTS, new BasicDBObject($ELEMMATCH, new BasicDBObject(OBJ_ID, id))); DBCursor find = storyCollection.find(criteria, new BasicDBObject(REF_RUNDOWN, 1)); @@ -212,10 +229,16 @@ public class OctopusAPI implements IOctopusAPI { // db.stories.find({ rundown: { $elemMatch: { id: 92950867 } }}) // { rundown: { $elemMatch: { id: 44622396 } }} List result = null; + ensureDB(); DBCollection collection = db.getCollection(STORY_COLLECTION); DBCursor find = collection - .find(new BasicDBObject(REF_RUNDOWN, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, id))), new BasicDBObject(ID, 1) - .append(PARENT_STORY_ID, 1).append(NAME, 1).append(MODIFIED, 1).append(REF_RUNDOWN, 1).append(FORMAT, 1).append(MOS_OBJECTS, 1)) + .find(new BasicDBObject(REF_RUNDOWN, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, id))), + new BasicDBObject(ID, 1).append(PARENT_STORY_ID, 1) + .append(NAME, 1) + .append(MODIFIED, 1) + .append(REF_RUNDOWN, 1) + .append(FORMAT, 1) + .append(MOS_OBJECTS, 1)) .sort(new BasicDBObject("name", 1)); if (find.hasNext()) result = find.toArray(); @@ -226,6 +249,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getRundownStories(long id, BasicDBObject fields) { List result = null; + ensureDB(); DBCollection collection = db.getCollection(STORY_COLLECTION); DBCursor find = collection.find(new BasicDBObject(REF_RUNDOWN, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, id)))) .sort(new BasicDBObject("name", 1)); @@ -259,6 +283,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getStories() { List result = null; + ensureDB(); DBCollection collection = db.getCollection(STORY_COLLECTION); DBCursor find = collection.find(new BasicDBObject(), new BasicDBObject("mosObjects", 1).append("_id", 0)).limit(1000); if (find.hasNext()) @@ -269,6 +294,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getStoriesByID(String id) { List result = null; + ensureDB(); DBCollection collection = db.getCollection(STORY_COLLECTION); DBCursor find = collection.find(new BasicDBObject(ID, id)); if (find.hasNext()) { @@ -283,6 +309,7 @@ public class OctopusAPI implements IOctopusAPI { //Pattern regex = Pattern.compile(id, Pattern.CASE_INSENSITIVE); //BasicDBObject query = new BasicDBObject("id", Pattern.compile(id)); List result = null; + ensureDB(); DBCollection collection = db.getCollection(STORY_COLLECTION); DBCursor find = collection.find(new BasicDBObject(PARENT_STORY_ID, id)); if (find.hasNext()) { @@ -295,6 +322,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getStoriesByPlaceHolderID(String id) { List result = new ArrayList<>(); + ensureDB(); DBCollection storyCollection = db.getCollection(STORY_COLLECTION); BasicDBObject criteria = new BasicDBObject(MOS_OBJECTS, new BasicDBObject($ELEMMATCH, new BasicDBObject(OBJ_ID, id))); DBCursor find = storyCollection.find(criteria); @@ -308,6 +336,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getStoryFolders() { List result = null; + ensureDB(); DBCollection collection = db.getCollection(FOLDER_COLLECTION); DBCursor find = collection.find(); if (find.hasNext()) @@ -317,6 +346,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getStoryFoldersByParentStoryID(String id) { + ensureDB(); DBCollection storyCollection = db.getCollection(STORY_COLLECTION); DBCursor find = storyCollection.find(new BasicDBObject(PARENT_STORY_ID, id), new BasicDBObject(REF_STORYFOLDER, 1)); if (!find.hasNext()) @@ -326,6 +356,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getStoryFoldersByPlaceHolderID(String id) { + ensureDB(); DBCollection storyCollection = db.getCollection(STORY_COLLECTION); BasicDBObject criteria = new BasicDBObject(MOS_OBJECTS, new BasicDBObject($ELEMMATCH, new BasicDBObject(OBJ_ID, id))); DBCursor find = storyCollection.find(criteria, new BasicDBObject(REF_STORYFOLDER, 1)); @@ -337,10 +368,16 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getStoryFolderStories(long storyFolderId) { List result = null; + ensureDB(); DBCollection collection = db.getCollection(STORY_COLLECTION); DBCursor find = collection - .find(new BasicDBObject(REF_STORYFOLDER, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, storyFolderId))), new BasicDBObject(ID, 1) - .append(PARENT_STORY_ID, 1).append(NAME, 1).append(MODIFIED, 1).append(REF_STORYFOLDER, 1).append(FORMAT, 1).append(MOS_OBJECTS, 1)) + .find(new BasicDBObject(REF_STORYFOLDER, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, storyFolderId))), + new BasicDBObject(ID, 1).append(PARENT_STORY_ID, 1) + .append(NAME, 1) + .append(MODIFIED, 1) + .append(REF_STORYFOLDER, 1) + .append(FORMAT, 1) + .append(MOS_OBJECTS, 1)) .sort(new BasicDBObject(NAME, 1)); if (find.hasNext()) result = find.toArray(); @@ -350,6 +387,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getStoryFolderStories(long storyFolderId, BasicDBObject fields) { List result = null; + ensureDB(); DBCollection collection = db.getCollection(STORY_COLLECTION); DBCursor find = collection.find(new BasicDBObject(REF_STORYFOLDER, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, storyFolderId))), fields) .sort(new BasicDBObject(NAME, 1)); diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMOutputStream.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMOutputStream.java index 469dd2fc..046ad35d 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMOutputStream.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMOutputStream.java @@ -38,9 +38,11 @@ public class TSMOutputStream extends OutputStream { logger.info("Closing stream"); try { //ha nem sikerult az iras, mar volt abort - if (success) + if (success) { client.commit(); - logger.info("Commit at close completed"); + logger.info("Commit at close completed"); + } else + logger.info("Skipping commit at close, session probaly terminated"); } catch (Exception e) { throw new IOException(e); } finally { diff --git a/server/user.jobengine.osgi.db/src/user/commons/pool/ContextPool.java b/server/user.jobengine.osgi.db/src/user/commons/pool/ContextPool.java index ef6ac7a5..e270456d 100644 --- a/server/user.jobengine.osgi.db/src/user/commons/pool/ContextPool.java +++ b/server/user.jobengine.osgi.db/src/user/commons/pool/ContextPool.java @@ -3,8 +3,7 @@ package user.commons.pool; import java.lang.reflect.InvocationTargetException; import java.sql.Connection; import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.Statement; +import java.sql.SQLException; import java.util.Properties; import org.apache.logging.log4j.LogManager; @@ -33,33 +32,40 @@ public class ContextPool extends ResourcePool { @Override protected boolean checkObject(Object resourceObject) { DefaultContext context = (DefaultContext) resourceObject; - boolean result = false; - String sql = "SELECT 1 FROM SYSIBM.SYSDUMMY1"; - Statement stmt = null; - ResultSet rs = null; - try { - stmt = context.getConnection().createStatement(); - rs = stmt.executeQuery(sql); - while (rs.next()) - rs.getInt(1); - result = true; - } catch (Exception e1) { - logger.catching(e1); - if (rs != null) - try { - rs.close(); - } catch (Exception e) { - logger.catching(e); - } - if (stmt != null) - try { - stmt.close(); - } catch (Exception e) { - logger.catching(e); - } + boolean result = false; + try { + result = !context.getConnection().isClosed(); + } catch (SQLException e) { } + logger.info("Context check {}", result); + // String sql = "SELECT 1 FROM SYSIBM.SYSDUMMY1"; + // Statement stmt = null; + // ResultSet rs = null; + // try { + // stmt = context.getConnection().createStatement(); + // rs = stmt.executeQuery(sql); + // while (rs.next()) + // rs.getInt(1); + // + // result = true; + // } catch (Exception e1) { + // logger.catching(e1); + // if (rs != null) + // try { + // rs.close(); + // } catch (Exception e) { + // logger.catching(e); + // } + // if (stmt != null) + // try { + // stmt.close(); + // } catch (Exception e) { + // logger.catching(e); + // } + // + // } return result; } diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobEngine.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobEngine.java index fdb40335..4578e940 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobEngine.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobEngine.java @@ -584,8 +584,8 @@ public class JobEngine implements IJobEngine { for (Job job : runningJobs) { Job runningJob = getJob(job.getId()); if (runningJob != null && runningJob.getStatus() != JobStatus.SUSPENDED) - throw new JobEngineException( - String.format("Can not submit job. Job with %s.%s already running", template.getFileName(), template.getName())); + throw new JobEngineException(String.format("Can not submit job. Job with %s.%s already running", template.getFileName(), + template.getName())); } } } @@ -849,6 +849,18 @@ public class JobEngine implements IJobEngine { runQueue.remove(jobRuntime); } + @Override + public void removeGarbage() { + List removeId = new ArrayList<>(); + for (Long id : submittedJobs.keySet()) { + IJobRuntime runtime = submittedJobs.get(id); + if (runtime != null && (JobStatus.SUSPENDED.equals(runtime.getStatus()) || JobStatus.CANCELED.equals(runtime.getStatus()))) + removeId.add(id); + } + for (Long id : removeId) + submittedJobs.remove(id); + } + @Override public void removeJob(long id) { if (submittedJobs.containsKey(id)) { @@ -877,18 +889,6 @@ public class JobEngine implements IJobEngine { } - @Override - public void removeGarbage() { - List removeId = new ArrayList<>(); - for (Long id : submittedJobs.keySet()) { - IJobRuntime runtime = submittedJobs.get(id); - if (runtime != null && (JobStatus.SUSPENDED.equals(runtime.getStatus()) || JobStatus.CANCELED.equals(runtime.getStatus()))) - removeId.add(id); - } - for (Long id : removeId) - submittedJobs.remove(id); - } - @Override public ClusteredJob requestJob(String className) throws Exception { if (!executors.containsKey(className)) @@ -1053,7 +1053,8 @@ public class JobEngine implements IJobEngine { result.addEventListener(statusListener); submit(result); } else { - logger.error("Unknown template: " + template); + logger.error("Unknown template {}", template); + throw new JobEngineException("Unknown template " + template); } return result; } 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 8f32f175..23e19ad5 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 @@ -1,7 +1,6 @@ package user.jobengine.server; import java.net.URLClassLoader; -import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; @@ -229,11 +228,23 @@ public class JobStepExecutor implements IJobStepExecutor { IJobStep result = null; if (isGroovyStep()) { - GroovyClassLoader gcl = new GroovyClassLoader(parentLoader); - Path stepRoot = Paths.get(System.getProperty("jobengine.jobsteps.groovy.root", "")); - gcl.addClasspath(stepRoot.toString()); - Class myClass = gcl.parseClass(Paths.get(stepRoot.toString(), stepUnitName).toFile()); - result = (IJobStep) myClass.newInstance(); + try (GroovyClassLoader gcl = new GroovyClassLoader(parentLoader)) { + String stepsDir = System.getProperty("jobengine.jobsteps.groovy.root", ""); + for (String executorName : jobEngine.getExecutors().keySet()) { + if (!executorName.endsWith(".java")) + continue; + + Class myClass = gcl.parseClass(Paths.get(stepsDir, executorName).toFile()); + if (stepUnitName.equals(executorName)) { + result = (IJobStep) myClass.newInstance(); + break; + } + } + } catch (Exception e) { + logger.error(e.getMessage()); + throw e; + } + } else result = stepClass.newInstance(); return result; diff --git a/server/user.jobengine.osgi.services/META-INF/MANIFEST.MF b/server/user.jobengine.osgi.services/META-INF/MANIFEST.MF index 09fcc754..0f81ddb9 100644 --- a/server/user.jobengine.osgi.services/META-INF/MANIFEST.MF +++ b/server/user.jobengine.osgi.services/META-INF/MANIFEST.MF @@ -17,6 +17,7 @@ Import-Package: com.fasterxml.jackson.annotation;version="2.4.5", com.ibm.nosql.bson, com.ibm.nosql.json, com.ibm.nosql.json.api, + com.ibm.nosql.json.util, javax.annotation;version="1.2.0", javax.servlet;version="3.1.0", javax.servlet.http;version="3.1.0", diff --git a/server/user.jobengine.osgi.services/src/user/jobengine/osgi/mediacube/MediaCubeService.java b/server/user.jobengine.osgi.services/src/user/jobengine/osgi/mediacube/MediaCubeService.java index 83d41f00..92c8a3ea 100644 --- a/server/user.jobengine.osgi.services/src/user/jobengine/osgi/mediacube/MediaCubeService.java +++ b/server/user.jobengine.osgi.services/src/user/jobengine/osgi/mediacube/MediaCubeService.java @@ -1,13 +1,16 @@ package user.jobengine.osgi.mediacube; import java.util.Set; +import java.util.stream.Collectors; +import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; +import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; @@ -15,6 +18,9 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.eclipse.core.runtime.adaptor.EclipseStarter; +import com.ibm.nosql.json.api.BasicDBObject; +import com.ibm.nosql.json.util.JSON; + import user.commons.MediaCubeMarker; import user.jobengine.db.IItemManager; import user.jobengine.db.IResultSetConsumer; @@ -24,13 +30,13 @@ import user.jobengine.db.JSONBase; import user.jobengine.db.Media; import user.jobengine.osgi.rest.ComponentBinder; import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; @Path("/jobengine") @SuppressWarnings("restriction") public class MediaCubeService { private static final Logger logger = LogManager.getLogger(); - private IItemManager itemManager = ComponentBinder.getItemManager(); public MediaCubeService() { logger.info("Created"); @@ -50,6 +56,51 @@ public class MediaCubeService { return result; } + @GET + @Path("/checkmediafile") + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) + public Response checkMediaFile(@QueryParam("mediaFileHouseId") String mediaFileHouseId, @QueryParam("store") String store) { + Response result = null; + try { + IItemManager itemManager = ComponentBinder.getItemManager(); + if (itemManager == null) + throw new Exception("No ItemManager found"); + if (mediaFileHouseId == null || mediaFileHouseId.trim().length() == 0) + throw new Exception("The 'mediaFileHouseId' parameter is not provided!"); + if (store == null || store.trim().length() == 0) + throw new Exception("The 'store' parameter is not provided!"); + BasicDBObject id[] = { new BasicDBObject() }; + String sql = String.format( + "select mf.mediaid, mf.houseId, mf.relativepath from MEDIAFILE mf, STORE s where mf.storeid = s.id and s.name='%s' and houseid LIKE '%s.%%'", + store, mediaFileHouseId); + IResultSetConsumer consumer = rs -> { + String origName = rs.getString("houseId"); + String tsmName = rs.getString("relativePath"); + long mediaId = rs.getLong("mediaId"); + if (origName.toUpperCase().endsWith(".MXF")) { + + id[0].put("origName", origName); + id[0].put("tsmName", tsmName); + id[0].put("mediaId", mediaId); + return false; + } + + if (origName.toUpperCase().endsWith(".MOV")) { + id[0].put("origName", origName); + id[0].put("tsmName", tsmName); + id[0].put("mediaId", mediaId); + } + return true; + }; + itemManager.executeQuery(sql, consumer, null); + result = Response.ok(id[0]).build(); + } catch (Exception e) { + result = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); + } + return result; + } + @POST @Path("/create") @Consumes({ MediaType.APPLICATION_JSON }) @@ -57,6 +108,7 @@ public class MediaCubeService { public Response create(JSONBase entity) { Response result = null; try { + IItemManager itemManager = ComponentBinder.getItemManager(); if (itemManager == null) throw new Exception("No ItemManager found"); itemManager.add(entity); @@ -74,6 +126,7 @@ public class MediaCubeService { public Response getItem() { Response result = null; try { + IItemManager itemManager = ComponentBinder.getItemManager(); if (itemManager == null) throw new Exception("No ItemManager found"); Item item = itemManager.createItem("xxx", "yyyy", "111"); @@ -91,6 +144,7 @@ public class MediaCubeService { public Response getMedia(@QueryParam("mediaHouseId") String mediaHouseId) { Response result = null; try { + IItemManager itemManager = ComponentBinder.getItemManager(); if (itemManager == null) throw new Exception("No ItemManager found"); @@ -137,6 +191,7 @@ public class MediaCubeService { public Response getTags() { Response result = null; try { + IItemManager itemManager = ComponentBinder.getItemManager(); if (itemManager == null) throw new Exception("No ItemManager found"); Set tags = itemManager.getAllTags().keySet(); @@ -175,6 +230,32 @@ public class MediaCubeService { return result; } + @GET + @Path("/jobstatus") + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) + public Response jobStatus(@QueryParam("jobId") long jobId) { + Response result = null; + try { + IItemManager itemManager = ComponentBinder.getItemManager(); + if (itemManager == null) + throw new Exception("No ItemManager found"); + if (jobId == 0) + throw new Exception("The 'jobId' parameter is not provided!"); + String status[] = { null }; + String sql = String.format("select status from JOB where id=%d", jobId); + IResultSetConsumer consumer = rs -> { + status[0] = rs.getString("status"); + return false; + }; + itemManager.executeQuery(sql, consumer, null); + result = Response.ok(status[0]).build(); + } catch (Exception e) { + result = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); + } + return result; + } + @GET @Path("/notify") @Consumes({ MediaType.APPLICATION_JSON }) @@ -206,4 +287,34 @@ public class MediaCubeService { } return result; } + + @POST + @Path("/startjob") + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) + public Response startJob(@QueryParam("template") String template, @QueryParam("name") String name, @Context HttpServletRequest request) { + + Response result = null; + try { + Object jsStr = request.getReader().lines().collect(Collectors.joining(System.lineSeparator())); + BasicDBObject jobParameters = (BasicDBObject) JSON.parse(String.valueOf(jsStr)); + + IJobEngine jobEngine = ComponentBinder.getJobengine(); + if (jobEngine == null) + throw new Exception("No JobEngine found"); + if (template == null || template.trim().length() == 0) + throw new Exception("The 'template' parameter is not provided!"); + if (name == null || name.trim().length() == 0) + throw new Exception("The 'name' parameter is not provided!"); + + IJobRuntime jobRuntime = jobEngine.submit(template, name, jobParameters); + if (jobRuntime == null) + throw new NullPointerException("Job submit error!"); + result = Response.ok(jobRuntime.getId()).build(); + } catch (Exception e) { + result = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); + } + return result; + } + } diff --git a/server/user.mediacube.gui/pages/searchitems.zul b/server/user.mediacube.gui/pages/searchitems.zul index 19a5b215..4be9d565 100644 --- a/server/user.mediacube.gui/pages/searchitems.zul +++ b/server/user.mediacube.gui/pages/searchitems.zul @@ -35,7 +35,7 @@
- +
diff --git a/server/user.mediacube.gui/src/user/jobengine/zk/model/SearchModel.java b/server/user.mediacube.gui/src/user/jobengine/zk/model/SearchModel.java index 1a8e6c43..e610c70a 100644 --- a/server/user.mediacube.gui/src/user/jobengine/zk/model/SearchModel.java +++ b/server/user.mediacube.gui/src/user/jobengine/zk/model/SearchModel.java @@ -543,7 +543,10 @@ public class SearchModel extends AsyncBaseModel { } private void handleSearchError(Exception e) { - Clients.showNotification(e.getMessage(), "error", search, "start_center", 3000); + if (e instanceof NullPointerException) + Clients.showNotification("Database query error!", "error", search, "start_center", 3000); + else + Clients.showNotification(e.getMessage(), "error", search, "start_center", 3000); logger.error(e); } diff --git a/server/user.tsm.client/src/user/tsm/client/TSMBufferedClient.java b/server/user.tsm.client/src/user/tsm/client/TSMBufferedClient.java index aaaffac8..88754909 100644 --- a/server/user.tsm.client/src/user/tsm/client/TSMBufferedClient.java +++ b/server/user.tsm.client/src/user/tsm/client/TSMBufferedClient.java @@ -159,14 +159,17 @@ public class TSMBufferedClient extends TSMClient { object.bytesWorked(byteCount); } catch (Exception e) { - logger.error("Catched error in send. System messahe is: {}", e.getMessage()); - vote(TSMAPIConstants.DSM_VOTE_ABORT); + logger.error("Catched error in send. System message is: {}", e.getMessage()); + try { + vote(TSMAPIConstants.DSM_VOTE_ABORT); + } catch (Exception e2) { + } throw e; } } private short vote(byte vote) throws TSMException { - logger.info("Vote"); + logger.info("Vote {}", vote); short result = TSMAPIConstants.DSM_RC_OK; DsmEndTxnExIn endTxnExIn = new DsmEndTxnExIn(); @@ -179,15 +182,15 @@ public class TSMBufferedClient extends TSMClient { logger.catching(e); } - // if (result == TSMAPIConstants.DSM_RC_CHECK_REASON_CODE) { - // logger.error("dsmEndTxnEx error, reason code {}", endTxnExOut.getReason()); - // } else { - // if (result != TSMAPIConstants.DSM_RC_OK) - // throw new TSMException(dsmHandle, rc, endTxnExOut.getReason()); - // } - - if (result != TSMAPIConstants.DSM_RC_OK) - throw new TSMException(dsmHandle, rc, endTxnExOut.getReason()); + if (vote != TSMAPIConstants.DSM_VOTE_ABORT) { + if (result == TSMAPIConstants.DSM_RC_CHECK_REASON_CODE) + logger.warn("DSM_VOTE_ABORT warning, reason code {}", endTxnExOut.getReason()); + } else { + if (result != TSMAPIConstants.DSM_RC_OK) { + logger.warn("DSM_VOTE_COMMIT error"); + throw new TSMException(dsmHandle, rc, endTxnExOut.getReason()); + } + } logger.info("Vote completed"); return result; -- 2.54.0