-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #122. Solved the synchronization issues with the GePiDataService.
All data now has a unique state associated with it. This dataSessionId is given around into the client to use as request context to identify the data to request. This circumvents the timing issues caused by synchronizing with respect to the Tapestry Session.
- Loading branch information
Showing
22 changed files
with
349 additions
and
216 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
gepi/gepi-core/src/main/java/de/julielab/gepi/core/retrieval/data/GePiData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package de.julielab.gepi.core.retrieval.data; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
import java.util.concurrent.Future; | ||
|
||
/** | ||
* A single class to hold the input and result data of a GePi request. | ||
*/ | ||
public class GePiData { | ||
public static final GePiData EMPTY = new GePiData(); | ||
private long sessionId; | ||
private Future<AggregatedEventsRetrievalResult> aggregatedResult; | ||
private Future<EventRetrievalResult> unrolledResult; | ||
private Future<IdConversionResult> listAIdConversionResult; | ||
private Future<IdConversionResult> listBIdConversionResult; | ||
|
||
public GePiData(Future<AggregatedEventsRetrievalResult> aggregatedResult, Future<EventRetrievalResult> unrolledResult, Future<IdConversionResult> listAIdConversionResult, Future<IdConversionResult> listBIdConversionResult) { | ||
this.aggregatedResult = aggregatedResult; | ||
this.unrolledResult = unrolledResult; | ||
this.listAIdConversionResult = listAIdConversionResult; | ||
this.listBIdConversionResult = listBIdConversionResult; | ||
} | ||
|
||
private GePiData() { | ||
// for the EMPTY constant | ||
} | ||
|
||
public long getSessionId() { | ||
return sessionId; | ||
} | ||
|
||
public void setSessionId(long sessionId) { | ||
this.sessionId = sessionId; | ||
} | ||
|
||
public Future<AggregatedEventsRetrievalResult> getAggregatedResult() { | ||
return aggregatedResult; | ||
} | ||
|
||
public Future<EventRetrievalResult> getUnrolledResult() { | ||
return unrolledResult; | ||
} | ||
|
||
public Future<IdConversionResult> getListAIdConversionResult() { | ||
return listAIdConversionResult; | ||
} | ||
|
||
public Future<IdConversionResult> getListBIdConversionResult() { | ||
return listBIdConversionResult; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
gepi/gepi-core/src/main/java/de/julielab/gepi/core/services/IChartsDataManager.java
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
gepi/gepi-core/src/main/java/de/julielab/gepi/core/services/IGePiDataService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package de.julielab.gepi.core.services; | ||
|
||
import java.util.List; | ||
|
||
import de.julielab.gepi.core.retrieval.data.AggregatedEventsRetrievalResult; | ||
import de.julielab.gepi.core.retrieval.data.GePiData; | ||
import org.apache.tapestry5.json.JSONArray; | ||
|
||
import de.julielab.gepi.core.retrieval.data.Event; | ||
import org.apache.tapestry5.json.JSONObject; | ||
|
||
public interface IGePiDataService { | ||
|
||
/** | ||
* <p>Puts data to the data cache. If the data already has a session ID, the respective cache entry will be updated. | ||
* Otherwise, a new ID will be generated and set to <tt>data</tt>. The final session ID is returned.</p> | ||
* | ||
* | ||
* @param dataSessionId | ||
* @param data The data of a new session. | ||
*/ | ||
void putData(long dataSessionId, GePiData data); | ||
|
||
/** | ||
* <p>Generates a new ID for a data session that can be used in {@link #getData(long)}}.</p> | ||
* | ||
* @return A new data session ID. | ||
*/ | ||
long newSession(); | ||
|
||
/** | ||
* <p>Returns the data associated with the given session ID.</p> | ||
* | ||
* @param sessionId The session ID for which the data should be retrieved. | ||
* @return The data of the session or {@link GePiData#EMPTY} if no such data exists. | ||
*/ | ||
GePiData getData(long sessionId); | ||
|
||
/** | ||
* input structure for pie chart and bar chart | ||
* | ||
* @return JSONArray - json array of tuples (itself realised as an json array) | ||
*/ | ||
JSONArray getTargetArgCount(List<Event> e); | ||
|
||
/** | ||
* input structure required for sankey graph | ||
* | ||
* @return JSONArray - array of triplets ([<from, <to>, count]) | ||
*/ | ||
JSONObject getPairedArgsCount(List<Event> e); | ||
|
||
JSONObject getPairedArgsCount(AggregatedEventsRetrievalResult aggregatedEvents); | ||
|
||
JSONObject getPairsWithCommonTarget(List<Event> evtList); | ||
|
||
JSONArray convertToJson(List<Event> eventList); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
gepi/gepi-webapp/src/main/java/de/julielab/gepi/webapp/components/CircleWidget.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.