Skip to content

Commit

Permalink
- Fixes as per @aaime review
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessio Fabiani committed Sep 21, 2018
1 parent b7da171 commit 4bee008
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.geoserver.wps.executor.ProcessStatusTracker; import org.geoserver.wps.executor.ProcessStatusTracker;
import org.geotools.data.Query; import org.geotools.data.Query;
import org.geotools.factory.CommonFactoryFinder; import org.geotools.factory.CommonFactoryFinder;
import org.geotools.filter.SortByImpl;
import org.geotools.util.logging.Logging; import org.geotools.util.logging.Logging;
import org.opengis.filter.Filter; import org.opengis.filter.Filter;
import org.opengis.filter.FilterFactory2; import org.opengis.filter.FilterFactory2;
Expand Down Expand Up @@ -186,13 +185,11 @@ protected List<ExecutionStatus> getFilteredItems() {


SortBy sortOrder = null; SortBy sortOrder = null;
if (sort != null) { if (sort != null) {
SortBy[] sortBys = new SortByImpl[1];
final Property<?> property = getProperty(sort); final Property<?> property = getProperty(sort);
if (property.isSearchable()) { // we really need another flag if (property.isSearchable()) { // we really need another flag
final String sortProperty = ((BeanProperty<StoreInfo>) property).getPropertyPath(); final String sortProperty = ((BeanProperty<StoreInfo>) property).getPropertyPath();
sortOrder = sortBy(sortProperty, sort.isAscending()); sortOrder = sortBy(sortProperty, sort.isAscending());
sortBys[0] = sortOrder; query.setSortBy(new SortBy[] {sortOrder});
query.setSortBy(sortBys);
} }
} }
LOGGER.fine("built query " + query + " to filter statuses"); LOGGER.fine("built query " + query + " to filter statuses");
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ public void fireProgress(float progress, String task) {
// By default we estimate the completion as: // By default we estimate the completion as:
// "time elapsed millis / percentage completed" // "time elapsed millis / percentage completed"
if (progress > 0) { if (progress > 0) {
long timeEalpsedMillis = long timeElapsedMillis =
(new Date().getTime() - status.getCreationTime().getTime()); (new Date().getTime() - status.getCreationTime().getTime());
int estimatedCompletionMillis = int estimatedCompletionMillis =
(int) (int)
((timeEalpsedMillis / progress) * timeEalpsedMillis ((timeElapsedMillis / progress) * timeElapsedMillis
+ timeEalpsedMillis); + timeElapsedMillis);
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(status.getCreationTime()); calendar.setTime(status.getCreationTime());
calendar.add(Calendar.MILLISECOND, estimatedCompletionMillis); calendar.add(Calendar.MILLISECOND, estimatedCompletionMillis);
Expand Down

0 comments on commit 4bee008

Please sign in to comment.