Skip to content

Commit

Permalink
Merge pull request #1 from Ben-Ramchandani/tworkserver
Browse files Browse the repository at this point in the history
Tworkserver
  • Loading branch information
razvankusz committed Feb 8, 2016
2 parents d9fa18f + a1c509c commit 71cfa2b
Show file tree
Hide file tree
Showing 143 changed files with 20,656 additions and 35 deletions.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file added tworkserver/.metadata/.mylyn/.tasks.xml.zip
Binary file not shown.
Binary file added tworkserver/.metadata/.mylyn/repositories.xml.zip
Binary file not shown.
Binary file added tworkserver/.metadata/.mylyn/tasks.xml.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
version=1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\n<launchPerspectives/>\n
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
action=ASK
eclipse.preferences.version=1
rememberSendAction=NONE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
content_assist_proposals_background=255,255,255
content_assist_proposals_foreground=60,60,60
eclipse.preferences.version=1
fontPropagated=true
org.eclipse.jdt.ui.editor.tab.width=
org.eclipse.jdt.ui.formatterprofiles.version=12
org.eclipse.jdt.ui.javadoclocations.migrated=true
org.eclipse.jface.textfont=1|Monospace|10.0|0|GTK|1|;
proposalOrderMigrated=true
spelling_locale=en_GB
spelling_locale_initialized=true
tabWidthPropagated=true
useAnnotationsPrefPage=true
useQuickDiffPrefPage=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.m2e.discovery.pref.projects=
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
mylyn.attention.migrated=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.mylyn.monitor.activity.tracking.enabled.checked=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
eclipse.preferences.version=1
migrated.task.repositories.secure.store=true
org.eclipse.mylyn.tasks.ui.filters.nonmatching=true
org.eclipse.mylyn.tasks.ui.filters.nonmatching.encouraged=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PROBLEMS_FILTERS_MIGRATE=true
eclipse.preferences.version=1
platformState=1454357554837
quickStart=false
tipsAndTricks=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
showIntro=false
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState=false
PLUGINS_NOT_ACTIVATED_ON_STARTUP=org.eclipse.m2e.discovery;
eclipse.preferences.version=1
2,325 changes: 2,325 additions & 0 deletions tworkserver/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
����version
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NRM�
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
����version
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NRM�
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<typeInfoHistroy/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<qualifiedTypeNameHistroy/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart">
<item value="2" key="layout"/>
<item value="true" key="group_libraries"/>
<item value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#x0A;&lt;packageExplorer group_libraries=&quot;1&quot; layout=&quot;2&quot; linkWithEditor=&quot;0&quot; rootMode=&quot;1&quot; workingSetName=&quot;Aggregate for window 1454853474594&quot;&gt;&#x0A;&lt;customFilters userDefinedPatternsEnabled=&quot;false&quot;&gt;&#x0A;&lt;xmlDefinedFilters&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.StaticsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.mylyn.java.ui.MembersFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.NonJavaProjectsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer_patternFilterId_.*&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.NonSharedProjectsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.SyntheticMembersFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.ContainedLibraryFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.internal.ui.PackageExplorer.HideInnerClassFilesFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.internal.ui.PackageExplorer.EmptyInnerPackageFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.m2e.MavenModuleFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.ClosedProjectsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.EmptyLibraryContainerFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.PackageDeclarationFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.ImportDeclarationFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.NonJavaElementFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.LibraryFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.CuAndClassFileFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.internal.ui.PackageExplorer.EmptyPackageFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.NonPublicFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.LocalTypesFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.FieldsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;/xmlDefinedFilters&gt;&#x0A;&lt;/customFilters&gt;&#x0A;&lt;/packageExplorer&gt;" key="memento"/>
<item value="1" key="rootMode"/>
<item value="false" key="linkWithEditor"/>
</section>
<section name="JavaElementSearchActions">
</section>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<configuration scan="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date [%thread] %-5level %logger{35} - %msg%n</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>OFF</level> <!-- change to DEBUG to mimic '-consolelog' behaviour -->
</filter>
</appender>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${org.eclipse.m2e.log.dir}/0.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<FileNamePattern>${org.eclipse.m2e.log.dir}/%i.log</FileNamePattern>
<MinIndex>1</MinIndex>
<MaxIndex>10</MaxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>100MB</MaxFileSize>
</triggeringPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date [%thread] %-5level %logger{35} - %msg%n</pattern>
</encoder>
</appender>

<appender name="EclipseLog" class="org.eclipse.m2e.logback.appender.EclipseLogAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
</appender>

<appender name="MavenConsoleLog" class="org.eclipse.m2e.logback.appender.MavenConsoleAppender">
</appender>

<root level="INFO">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
<appender-ref ref="EclipseLog" />
<appender-ref ref="MavenConsoleLog" />
</root>

<logger name="com.ning.http.client" level="INFO" />
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<setup:Workspace
xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
name="workspace"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="ExternalProjectImportWizard">
<item value="false" key="WizardProjectsImportPage.STORE_NESTED_PROJECTS"/>
<item value="false" key="WizardProjectsImportPage.STORE_COPY_PROJECT_ID"/>
<item value="false" key="WizardProjectsImportPage.STORE_ARCHIVE_SELECTED"/>
<list key="WizardProjectsImportPage.STORE_DIRECTORIES">
<item value="/home/razvan/groupproject/team_mike/tworkserver"/>
</list>
<list key="WizardProjectsImportPage.STORE_ARCHIVES">
<item value=""/>
</list>
</section>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="org.eclipse.ui.internal.QuickAccess">
<item value="-1" key="dialogHeight"/>
<item value="-1" key="dialogWidth"/>
<list key="textEntries">
</list>
<list key="orderedElements">
</list>
<list key="orderedProviders">
</list>
<list key="textArray">
</list>
</section>
<section name="NewWizardAction">
</section>
<section name="ImportExportAction">
</section>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<workingSetManager>
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1454853474594_0" label="Window Working Set" name="Aggregate for window 1454853474594"/>
</workingSetManager>
3 changes: 3 additions & 0 deletions tworkserver/.metadata/version.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Sun Feb 07 14:05:31 GMT 2016
org.eclipse.core.runtime=2
org.eclipse.platform=4.5.1.v20150904-0015
2 changes: 1 addition & 1 deletion tworkserver/.settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Generated by sbteclipse
#Sun Feb 07 10:21:11 GMT 2016
#Sun Feb 07 14:37:32 GMT 2016
encoding/<project>=UTF-8
2 changes: 1 addition & 1 deletion tworkserver/.settings/org.scala-ide.sdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Generated by sbteclipse
#Sun Feb 07 10:21:11 GMT 2016
#Sun Feb 07 14:37:32 GMT 2016
scala.compiler.additionalParams=-encoding utf8
deprecation=true
unchecked=true
Expand Down
15 changes: 9 additions & 6 deletions tworkserver/app/controllers/Application.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
package controllers;

import java.io.File;
import java.util.UUID;

import models.Data;
import models.Job;
import play.mvc.Controller;
<<<<<<< HEAD
import play.mvc.Http.RequestBody;
import play.mvc.Http.MultipartFormData.FilePart;
=======
>>>>>>> d9fa18f7783cd06089587da03b35086da7e16ec3
import play.mvc.Result;
import twork.Device;
import twork.Devices;
Expand All @@ -15,12 +21,9 @@

public class Application extends Controller {

public Result index() {

String remote = request().remoteAddress();
return ok(remote);
}




public Result available() {
/*
* gives the phone a UUID
Expand Down
46 changes: 46 additions & 0 deletions tworkserver/app/controllers/Web.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package controllers;

import java.io.File;
import java.util.Arrays;
import java.util.List;

import java.util.Map;

import play.mvc.Controller;
import play.mvc.Http.MultipartFormData.FilePart;
import play.mvc.Http.RequestBody;
import play.mvc.Result;

public class Web extends Controller{

public Result index() {
List<String> l = (List) Arrays.asList("Prime Computation","Image Processing");
return ok(views.html.main.render("test", l, new play.twirl.api.Html("something")));
}


public Result upload() {
RequestBody body = request().body();
play.mvc.Http.MultipartFormData fileBody = body.asMultipartFormData();
String immediateInput = fileBody.asFormUrlEncoded().get("input")[0];
String computationID = "1";

assert(immediateInput!=null);

List<FilePart> files = fileBody.getFiles();
for (FilePart filePart : files) {
if (filePart != null) {
String filename = filePart.getFilename();
String contentType = filePart.getContentType();
File file = filePart.getFile();
return ok("File uploaded " + immediateInput +" "+computationID);
}
else {
flash("error", "Missing file");
return ok();
}
}
return ok();
}

}
13 changes: 13 additions & 0 deletions tworkserver/app/models/Computation.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,33 @@
@Table(name = "all_computation")
public class Computation extends Model {

public static final int STATE_FAILED = 1;
public static final int STATE_RUNNING = 2;
public static final int STATE_COMPLETED = 3;

@Id
public UUID computationID;
public String functionName;
//Purely descriptive name
public String computationName;

<<<<<<< HEAD

public boolean failed;
public boolean running;
//Has the result of this computation been collected?
public boolean completed;
//A single field should suffice here?
public int state;
=======
//UUID of the customer computation that spawned this (can be NULL_UUID).
public UUID customerComputationID;

//public boolean failed;
//public boolean running;
//Has the result of this computation been collected?
//public boolean completed;
>>>>>>> d9fa18f7783cd06089587da03b35086da7e16ec3

public int jobsLeft;

Expand Down
6 changes: 0 additions & 6 deletions tworkserver/app/twork/JobScheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ The network handler will call getJob() to fetch a job, and submitJob() when a co
and timing out jobs that don't come back for too long.
*/

/*
* Make this singleton.
* Pass in the device to getJob() so we can allow at some point the users to choose computations
* Maybe it shouldn't be an interface as we will have a way to find priority for the Job type -> so only one way to Schedule.
*/

private static final long maxFailCount = 3;

//Decorator for jobs
Expand Down
6 changes: 0 additions & 6 deletions tworkserver/app/views/index.scala.html
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
@(message: String)

@main("Welcome to Play") {

@play20.welcome(message, style = "Java")

}
Loading

0 comments on commit 71cfa2b

Please sign in to comment.