From: vasary.daniel Date: Wed, 10 Feb 2021 14:44:25 +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=b8518c65814675ca59819e0e5565ed5125ae60d2;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C32146 --- diff --git a/server/-configuration/run-mediacube-server-hirtv.launch b/server/-configuration/run-mediacube-server-hirtv.launch index 340263dc..48c21127 100644 --- a/server/-configuration/run-mediacube-server-hirtv.launch +++ b/server/-configuration/run-mediacube-server-hirtv.launch @@ -1,30 +1,119 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/run-mediacube-server-mv.launch b/server/-configuration/run-mediacube-server-mv.launch index 9b9b141c..213a562e 100644 --- a/server/-configuration/run-mediacube-server-mv.launch +++ b/server/-configuration/run-mediacube-server-mv.launch @@ -1,31 +1,119 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/run-mediacube-server-test.launch b/server/-configuration/run-mediacube-server-test.launch index e4391816..f930cb2e 100644 --- a/server/-configuration/run-mediacube-server-test.launch +++ b/server/-configuration/run-mediacube-server-test.launch @@ -1,30 +1,118 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/hu.user.mediacube.executors.tests/settings/application.yaml b/server/hu.user.mediacube.executors.tests/settings/application.yaml new file mode 100644 index 00000000..39e7b952 --- /dev/null +++ b/server/hu.user.mediacube.executors.tests/settings/application.yaml @@ -0,0 +1,49 @@ +datasource: + mediacube: + url: jdbc:db2://10.10.1.27:50000/mc + user: db2admin + password: password + external-indexer: false + simple-search: true + login-timeout: 3 + pool-size: 10 + mediacube-nosql: + url: jdbc:db2://10.10.1.27:50000/mc + user: db2admin + password: password + schema: test + login-timeout: 3 + nexio: + url: jdbc:sqlserver://10.10.1.59:1433;databaseName=NXDB; + user: sa + password: resolve +services: + ffmpeg: + execurable-location: /opt/ffmpeg/ffmpeg + mediacube: + proxy-root: /mediacube/data/lowres/www/video + nexio: + host: 10.10.1.55 + collection-name: nexioclips + use-mos-gateway: true + disabled: true + octopus: + api: + address: http://10.10.1.11/api/v1 + user: mama + password: napocska + rundowns-collection-name: rundowns + stories-collection-name: stories + folders-collection-name: storyfolders +jobs: + validate-transfers: false + copy-buffer-size: 32768 + scheduled-execution-disabled: true +tsm: + randomize-archives: false + delimiter: / + node-name: JOBENGINE + fs-name: /JOBENGINE + alternate-fs-name: /JOBENGINE + hl-name: /JOBENGINE + \ No newline at end of file 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 f078e65d..818af045 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 @@ -47,6 +47,7 @@ import org.junit.Test; import com.ibm.nosql.json.api.BasicDBList; import com.ibm.nosql.json.api.BasicDBObject; +import com.ibm.nosql.json.api.DBObject; import groovy.lang.GroovyClassLoader; import user.commons.RemoteFile; @@ -56,6 +57,8 @@ import user.commons.configuration.SystemConfiguration; import user.commons.mediaarea.StreamKind; import user.commons.mediatool.Timecode; import user.commons.mediatool.Timecode.Type; +import user.commons.octopus.IOctopusAPI; +import user.commons.octopus.OctopusAPI; import user.commons.remotestore.RemoteStoreProtocol; import user.jobengine.db.Media; import user.jobengine.server.steps.ArchiveItem; @@ -898,11 +901,12 @@ public class SmallTests { return id.split(" / ")[0]; else return id; - }).forEach(id1 -> { - //System.out.println(id1.toString()); - mcjob.add(id1.toString()); + }) + .forEach(id1 -> { + //System.out.println(id1.toString()); + mcjob.add(id1.toString()); - }); + }); // List mc = Files.readAllLines(Paths.get("/opt/AMC/mc-all-modified.txt")); Map tsmmap = new HashMap<>(); @@ -1224,4 +1228,13 @@ public class SmallTests { List k = conf.value("k"); List l = conf.value("l"); } + + @Test + public void test99999() throws Exception { + IOctopusAPI octopusAPI = new OctopusAPI(); + for (int i = 0; i < 100000; i++) { + List rundowns = octopusAPI.getRundowns(null); + System.out.println(rundowns.size()); + } + } } 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 9183daa5..703d0413 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 @@ -20,7 +20,6 @@ import user.commons.nosql.NoSQLUtils; public class OctopusAPI implements IOctopusAPI { //private static final Logger logger = LogManager.getLogger(); - private DB db; public OctopusAPI() throws SQLException { @@ -42,11 +41,6 @@ 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) { @@ -67,7 +61,7 @@ public class OctopusAPI implements IOctopusAPI { if (ids == null) return null; List result = null; - ensureDB(); + DB db = NoSQLUtils.getNoSQLDB(); DBCollection rundownCollection = db.getCollection(referenceCollectionName); BasicDBObject query = (BasicDBObject) QueryBuilder.start().put(ID).in(ids).get(); DBCursor findParents = rundownCollection.find(query); @@ -80,7 +74,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public DBObject getRundown(Date scheduledDate) { DBObject result = null; - ensureDB(); + DB db = NoSQLUtils.getNoSQLDB(); DBCollection collection = db.getCollection(RUNDOWN_COLLECTION); DBCursor find = collection.find(new BasicDBObject(SCHEDULED_START, scheduledDate)); if (find.hasNext()) @@ -91,7 +85,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public DBObject getRundownByID(long rundownID) { DBObject result = null; - ensureDB(); + DB db = NoSQLUtils.getNoSQLDB(); DBCollection collection = db.getCollection(RUNDOWN_COLLECTION); DBCursor find = collection.find(new BasicDBObject(ID, rundownID)); if (find.hasNext()) @@ -148,7 +142,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getRundownFullStories(long id) { List result = null; - ensureDB(); + DB db = NoSQLUtils.getNoSQLDB(); 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)); @@ -175,8 +169,10 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getRundowns(Date scheduledDate) { List result = null; - ensureDB(); - DBCollection collection = db.getCollection(RUNDOWN_COLLECTION); + //ensureDB(); + DB db1 = NoSQLUtils.getNoSQLDB(); + + DBCollection collection = db1.getCollection(RUNDOWN_COLLECTION); Calendar calStart = CalendarUtils.createZeroCalendar(scheduledDate); Calendar calStop = CalendarUtils.createZeroCalendar(scheduledDate); calStop.add(Calendar.DAY_OF_MONTH, 1); @@ -186,8 +182,10 @@ public class OctopusAPI implements IOctopusAPI { if (scheduledDate == null) { query = builder.get(); } else { - query = builder.and(QueryBuilder.start(SCHEDULED_START).greaterThanEquals(calStart.getTime()).get(), - QueryBuilder.start(SCHEDULED_START).lessThan(calStop.getTime()).get()).get(); + query = builder + .and(QueryBuilder.start(SCHEDULED_START).greaterThanEquals(calStart.getTime()).get(), + QueryBuilder.start(SCHEDULED_START).lessThan(calStop.getTime()).get()) + .get(); } //logger.info(query); @@ -199,7 +197,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getRundownsByParentStoryID(String id) { - ensureDB(); + DB db = NoSQLUtils.getNoSQLDB(); DBCollection storyCollection = db.getCollection(STORY_COLLECTION); DBCursor find = storyCollection.find(new BasicDBObject(PARENT_STORY_ID, id), new BasicDBObject(REF_RUNDOWN, 1)); if (!find.hasNext()) @@ -210,7 +208,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getRundownsByPlaceHolderID(String id) { //db.testStoryCollection.find({"mosObjects": {$elemMatch: {"globalId": "OCTOPUS-ECHOTV-2429902"}}}) - ensureDB(); + DB db = NoSQLUtils.getNoSQLDB(); 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)); @@ -229,7 +227,7 @@ public class OctopusAPI implements IOctopusAPI { // db.stories.find({ rundown: { $elemMatch: { id: 92950867 } }}) // { rundown: { $elemMatch: { id: 44622396 } }} List result = null; - ensureDB(); + DB db = NoSQLUtils.getNoSQLDB(); DBCollection collection = db.getCollection(STORY_COLLECTION); DBCursor find = collection .find(new BasicDBObject(REF_RUNDOWN, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, id))), @@ -249,7 +247,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getRundownStories(long id, BasicDBObject fields) { List result = null; - ensureDB(); + DB db = NoSQLUtils.getNoSQLDB(); 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)); @@ -283,7 +281,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getStories() { List result = null; - ensureDB(); + DB db = NoSQLUtils.getNoSQLDB(); DBCollection collection = db.getCollection(STORY_COLLECTION); DBCursor find = collection.find(new BasicDBObject(), new BasicDBObject("mosObjects", 1).append("_id", 0)).limit(1000); if (find.hasNext()) @@ -294,7 +292,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getStoriesByID(String id) { List result = null; - ensureDB(); + DB db = NoSQLUtils.getNoSQLDB(); DBCollection collection = db.getCollection(STORY_COLLECTION); DBCursor find = collection.find(new BasicDBObject(ID, id)); if (find.hasNext()) { @@ -309,7 +307,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(); + DB db = NoSQLUtils.getNoSQLDB(); DBCollection collection = db.getCollection(STORY_COLLECTION); DBCursor find = collection.find(new BasicDBObject(PARENT_STORY_ID, id)); if (find.hasNext()) { @@ -322,7 +320,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getStoriesByPlaceHolderID(String id) { List result = new ArrayList<>(); - ensureDB(); + DB db = NoSQLUtils.getNoSQLDB(); 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); @@ -336,7 +334,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getStoryFolders() { List result = null; - ensureDB(); + DB db = NoSQLUtils.getNoSQLDB(); DBCollection collection = db.getCollection(FOLDER_COLLECTION); DBCursor find = collection.find(); if (find.hasNext()) @@ -346,7 +344,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getStoryFoldersByParentStoryID(String id) { - ensureDB(); + DB db = NoSQLUtils.getNoSQLDB(); DBCollection storyCollection = db.getCollection(STORY_COLLECTION); DBCursor find = storyCollection.find(new BasicDBObject(PARENT_STORY_ID, id), new BasicDBObject(REF_STORYFOLDER, 1)); if (!find.hasNext()) @@ -356,7 +354,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getStoryFoldersByPlaceHolderID(String id) { - ensureDB(); + DB db = NoSQLUtils.getNoSQLDB(); 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)); @@ -368,7 +366,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getStoryFolderStories(long storyFolderId) { List result = null; - ensureDB(); + DB db = NoSQLUtils.getNoSQLDB(); DBCollection collection = db.getCollection(STORY_COLLECTION); DBCursor find = collection .find(new BasicDBObject(REF_STORYFOLDER, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, storyFolderId))), @@ -387,7 +385,7 @@ public class OctopusAPI implements IOctopusAPI { @Override public List getStoryFolderStories(long storyFolderId, BasicDBObject fields) { List result = null; - ensureDB(); + DB db = NoSQLUtils.getNoSQLDB(); 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.services/src/user/jobengine/osgi/rest/octopus/OctopusRESTService.java b/server/user.jobengine.osgi.services/src/user/jobengine/osgi/rest/octopus/OctopusRESTService.java index 81f73ad4..20e35832 100644 --- a/server/user.jobengine.osgi.services/src/user/jobengine/osgi/rest/octopus/OctopusRESTService.java +++ b/server/user.jobengine.osgi.services/src/user/jobengine/osgi/rest/octopus/OctopusRESTService.java @@ -112,6 +112,7 @@ public class OctopusRESTService { logger.trace("Entry {}", scheduledDate); Response result = null; try { + logger.info("Query rundowns"); Date calendar = null; if (scheduledDate != null) {