| ID | 13 |Running tasks | 14 |Global limit | 15 |
|---|---|---|
| {{res.id}} | 20 |{{res.runningTasks}} | 21 |{{res.actualLimit}} | 22 |
2 | Majordodo is a replicated service to build complex multi-tenant computing grids.
3 | You can view it as a distributed threadpool where tasks are submitted by users and a network of brokers schedules execution on a large set of machines, caring about failures, recovery and priority-based resources assignment.
Tasks are implemented in Java and can be submitted and monitored using a simple HTTP REST JSON API.
4 |
57 | * Will discard smalled elements if needed (invoked from 58 | * {@link #add(Object)} too). 59 | *
60 | */ 61 | @Override 62 | public boolean offer(E e) 63 | { 64 | 65 | if ( this.size() < maxSize ) 66 | return super.offer(e); 67 | 68 | if ( e.compareTo(this.peek()) > 0 ) 69 | { 70 | this.remove(); 71 | 72 | return super.offer(e); 73 | } 74 | 75 | return false; 76 | 77 | } 78 | 79 | } -------------------------------------------------------------------------------- /majordodo-web-ui/src/main/webapp/angular/angular-cookies.min.js.map: -------------------------------------------------------------------------------- 1 | { 2 | "version":3, 3 | "file":"angular-cookies.min.js", 4 | "lineCount":7, 5 | "mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkBC,CAAlB,CAA6B,CAmBtCD,CAAAE,OAAA,CAAe,WAAf,CAA4B,CAAC,IAAD,CAA5B,CAAAC,QAAA,CAyBW,UAzBX,CAyBuB,CAAC,YAAD,CAAe,UAAf,CAA2B,QAAS,CAACC,CAAD,CAAaC,CAAb,CAAuB,CAAA,IACxEC,EAAU,EAD8D,CAExEC,EAAc,EAF0D,CAGxEC,CAHwE,CAIxEC,EAAU,CAAA,CAJ8D,CAKxEC,EAAOV,CAAAU,KALiE,CAMxEC,EAAcX,CAAAW,YAGlBN,EAAAO,UAAA,CAAmB,QAAQ,EAAG,CAC5B,IAAIC,EAAiBR,CAAAC,QAAA,EACjBE,EAAJ,EAA0BK,CAA1B,GACEL,CAGA,CAHqBK,CAGrB,CAFAH,CAAA,CAAKG,CAAL,CAAqBN,CAArB,CAEA,CADAG,CAAA,CAAK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,CAAAyB,SAAA,CAAiBP,CAAjB,CAAR,CAAkCA,CAFxB,CAXd,KA0BAQ,QAAQ,CAACF,CAAD,CAAMN,CAAN,CAAa,CACxBI,CAAA,CAASE,CAAT,CAAA,CAAgBxB,CAAA2B,OAAA,CAAeT,CAAf,CADQ,CA1BrB,QAuCGU,QAAQ,CAACJ,CAAD,CAAM,CACpB,OAAOF,CAAA,CAASE,CAAT,CADa,CAvCjB,CAF8C,CAAhC,CAlI3B,CAnBsC,CAArC,CAAA,CAsMEzB,MAtMF,CAsMUA,MAAAC,QAtMV;", 6 | "sources":["angular-cookies.js"], 7 | "names":["window","angular","undefined","module","factory","$rootScope","$browser","cookies","lastCookies","lastBrowserCookies","runEval","copy","isUndefined","addPollFn","currentCookies","$apply","$watch","push","name","value","updated","isString","browserCookies","$cookies","get","key","fromJson","put","toJson","remove"] 8 | } 9 | -------------------------------------------------------------------------------- /majordodo-worker/src/main/java/majordodo/executors/TaskExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | package majordodo.executors; 21 | 22 | import java.util.Map; 23 | 24 | /** 25 | * Implementation of the execution of a task 26 | * 27 | * @author enrico.olivelli 28 | */ 29 | public class TaskExecutor { 30 | 31 | public static final String PARAMETER_CODEPOOL = "codepool"; 32 | public static final String PARAMETER_MODE = "mode"; 33 | public static final String PARAMETER_TASKTYPE = "tasktype"; 34 | public static final String PARAMETER_USERID = "userid"; 35 | public static final String PARAMETER_ATTEMPT = "attempt"; 36 | public static final String PARAMETER_DATA = "parameter"; 37 | public static final String PARAMETER_TASKID = "taskid"; 38 | 39 | /** 40 | * Implement the task. Any Exception thrown but this method will be treated as "errors" and Task will be re-submitted for recovery 41 | * @param parameters 42 | * @return 43 | * @throws Exception 44 | * @see #PARAMETER_ATTEMPT 45 | * @see #PARAMETER_CODEPOOL 46 | * @see #PARAMETER_DATA 47 | * @see #PARAMETER_MODE 48 | * @see #PARAMETER_TASKID 49 | * @see #PARAMETER_TASKTYPE 50 | * @see #PARAMETER_USERID 51 | */ 52 | public String executeTask(Map