Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added dispatcher and output format #1

Open
wants to merge 16 commits into
base: ogc-nsg-profile
Choose a base branch
from

Conversation

xandros6
Copy link

No description provided.

<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore.xmi</artifactId>
<version>2.12.0</version>
</dependency>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to declare the version here (and it should not be done here anyway), GS root pom.xml dependency-management section already declare this dependency with the same version.

All dependencies should always be declared on the root pom.xml dependency management section to force every core module, extension and community module to sue the same version.

*
* @param currentDataStoreParams
* @param currentDataStore
*/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid java-doc @param values, this function has only one parameter.

* @param timeToLive
*/
public static void setTimeToLive(Long timeToLive) {
IndexConfiguration.timeToLive = timeToLive;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When dealing with times the time unit should always be clearly defined, for example timeToLiveSec or better the method could named setTimeToLiveInSec, another more advanced option is too explicitly ask the invoker to provide the time unit using the TimeUnit enum.


public static Long getTimeToLive() {
return timeToLive;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the setter method, the time unit used should be clearly stayed, for example getTimeToLiveInSec or getSecondsToLive.

private static Resource storageResource;

private static Long timeToLive = 600l;

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The time unit used should be explicitly stayed.

featureStore.addFeatures(collection);

// Create and store file
Resource storageResource = IndexConfiguration.getStorageResource();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be that this block of code and the IndexInitializer manage methods should by synchronizer by a read-write lock. If a request comes and we get the storage location but in the meantime the storage location is changed, this request will be stored in the old path causing a very nasty bug to found.

I think the best option here would be a ReadWriteLock shared by the IndexConfiguration and used by the IndexInitializer and the IndexOutputFormat. Any operation that needs to access the storage and database should need a read lock (multiple threads will be able to access it at the same time) but the operations in IndexInitializer will need to obtain a write lock.


public class IndexResultTypeDispatcherCallback extends AbstractDispatcherCallback {

static Logger LOGGER = Logging.getLogger(IndexResultTypeDispatcherCallback.class);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be private and final.

Filter filter = CQL.toFilter("ID = '" + resultSetID + "'");
store.modifyFeatures("updated", new Date().getTime(), filter);
// Retrieve GetFeature from file
Resource storageResource = IndexConfiguration.getStorageResource();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same concurrent issue that when storing.


public class PageResultsDispatcherCallback extends AbstractDispatcherCallback {

static Logger LOGGER = Logging.getLogger(PageResultsDispatcherCallback.class);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be private and final.

PageResultsWebFeatureService prService = (PageResultsWebFeatureService) service
.getService();
prService.setResultSetID((String) request.getKvp().get("resultSetID"));
request.getKvp().put("featureId", Arrays.asList("dummy"));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is a hack that may be removed ... in this cases is better use Collections.singletonList("dummy").

@xandros6
Copy link
Author

xandros6 commented Sep 2, 2017 via email

@nmco
Copy link
Owner

nmco commented Sep 2, 2017

Hi Sandro,

I'm working on the EMF issue, I manage to fix the issue you are experiencing but then it fails on the deserialization of a complex query. EMF (what else expecting from this) will probably not do, I'm working on an alternative solution. I will provide you the code that serializes the query and gets is result back.

nmco pushed a commit that referenced this pull request Nov 22, 2018
nmco pushed a commit that referenced this pull request May 9, 2020
WIP: implementation of the HTML pages for GSR services using freemark…
nmco pushed a commit that referenced this pull request Jan 30, 2022
nmco pushed a commit that referenced this pull request Jan 30, 2022
nmco pushed a commit that referenced this pull request Jan 30, 2022
Update JDBCx documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants