Issue #1561 more efficient query of GFE files

Change-Id: Ib1715d76749bbe75bd8c1ad03263303c14500eb9

Former-commit-id: 5c7dc36583 [formerly cdfea29b16 [formerly 41ae249c3b75684c44d7b0b0624ebdecdbf656ee]]
Former-commit-id: cdfea29b16
Former-commit-id: 04e78d5a64
This commit is contained in:
Nate Jensen 2013-08-07 11:40:19 -05:00
parent 6d7d504f20
commit 86d32ce3e0
6 changed files with 89 additions and 73 deletions

View file

@ -45,6 +45,7 @@ import com.raytheon.uf.common.dataplugin.gfe.server.notify.GridHistoryUpdateNoti
import com.raytheon.uf.common.dataplugin.gfe.server.notify.GridUpdateNotification;
import com.raytheon.uf.common.dataplugin.gfe.server.notify.LockNotification;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationException;
@ -105,6 +106,7 @@ import com.raytheon.viz.gfe.core.parm.vcparm.VCModuleJobPool;
* modified parms.
* 05/02/2013 #1969 randerso Cleaned up and optimized processing of DBInvChangedNotification
* 05/14/2013 #2004 randerso Improved error handling
* 08/06/2013 #1561 njensen Use pm.listFiles() instead of pm.listStaticFiles()
*
* </pre>
*
@ -2046,9 +2048,11 @@ public abstract class AbstractParmManager implements IParmManager {
private List<VCModule> initVirtualCalcParmDefinitions() {
// retrieve the inventory from the ifpServer
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationFile[] modules = pathMgr.listStaticFiles(
FileUtil.join("gfe", "vcmodule"), new String[] { "py" }, false,
true);
LocalizationFile[] modules = pathMgr
.listFiles(
pathMgr.getLocalSearchHierarchy(LocalizationType.COMMON_STATIC),
FileUtil.join("gfe", "vcmodule"),
new String[] { "py" }, false, true);
List<VCModule> definitions = new ArrayList<VCModule>(modules.length);
for (LocalizationFile mod : modules) {

View file

@ -108,6 +108,7 @@ import com.vividsolutions.jts.geom.Envelope;
* 02/12/2013 #1597 randerso Improved error message for exceptions evaluating queries
* 02/26/2013 #1708 randerso Removed no longer needed near duplicate methods
* 06/21/2013 14983 ryu Added method for synchronous evaluation of query.
* 08/06/2013 1561 njensen Use pm.listFiles() instead of pm.listStaticFiles()
*
* </pre>
*
@ -229,9 +230,11 @@ public class ReferenceSetManager implements IReferenceSetManager,
private void getInventory() {
// load the complete list of edit areas
List<ReferenceID> refIDs = new ArrayList<ReferenceID>();
LocalizationFile[] contents = PathManagerFactory.getPathManager()
.listStaticFiles(EDIT_AREAS_DIR, new String[] { ".xml" },
false, true);
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationContext[] ctx = pm
.getLocalSearchHierarchy(LocalizationType.COMMON_STATIC);
LocalizationFile[] contents = pm.listFiles(ctx, EDIT_AREAS_DIR,
new String[] { ".xml" }, false, true);
if (contents != null) {
for (LocalizationFile lf : contents) {
String s = LocalizationUtil.extractName(lf.getName());
@ -242,9 +245,8 @@ public class ReferenceSetManager implements IReferenceSetManager,
}
// load the edit area group lists
LocalizationFile[] groupFiles = PathManagerFactory.getPathManager()
.listStaticFiles(EDIT_AREA_GROUPS_DIR, new String[] { ".txt" },
false, true);
LocalizationFile[] groupFiles = pm.listFiles(ctx, EDIT_AREA_GROUPS_DIR,
new String[] { ".txt" }, false, true);
if (groupFiles != null) {
for (LocalizationFile lf : groupFiles) {
loadGroup(lf);
@ -1756,8 +1758,8 @@ public class ReferenceSetManager implements IReferenceSetManager,
try {
ea = coordinator.submitSyncJob(executor);
} catch (Exception e) {
statusHandler.handle(Priority.ERROR,
"Failed to evaluate query: " + query, e);
statusHandler.handle(Priority.ERROR, "Failed to evaluate query: "
+ query, e);
}
return ea;

View file

@ -67,6 +67,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Apr 14, 2008 879 rbell Initial creation
* 11Jun2008 #1193 ebabin Updates for toggling lat/lon for sample set.
* Apr 9, 2009 1288 rjpeter Added ISampleSetChangedListener handling.
* Aug 6, 2013 1561 njensen Use pm.listFiles() instead of pm.listStaticFiles()
* </pre>
*
* @author rbell
@ -115,8 +116,9 @@ public class SampleSetManager implements ISampleSetManager {
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationFile[] files = pm.listStaticFiles(SAMPLE_SETS_DIR,
new String[] { ".xml" }, true, true);
LocalizationFile[] files = pm.listFiles(
pm.getLocalSearchHierarchy(LocalizationType.COMMON_STATIC),
SAMPLE_SETS_DIR, new String[] { ".xml" }, true, true);
for (LocalizationFile file : files) {
String fn = LocalizationUtil.extractName(file.getName()).replace(

View file

@ -61,6 +61,7 @@ import com.raytheon.viz.gfe.core.msgs.SelectTimeRangesChangedMsg;
* ------------ ---------- ----------- --------------------------
* Dec 3, 2009 #3135 randerso Initial creation
* Aug 1, 2012 #965 dgilling Change location of SelectTimeRange.
* Aug 6, 2013 #1561 njensen Use pm.listFiles() instead of pm.listStaticFiles()
*
* </pre>
*
@ -209,8 +210,9 @@ public class SelectTimeRangeManager implements ISelectTimeRangeManager,
@Override
public void fileUpdated(FileUpdatedMessage message) {
LocalizationFile[] files = pathManager.listStaticFiles(FILE_PATH,
new String[] { FILE_EXT }, false, true);
LocalizationFile[] files = pathManager.listFiles(pathManager
.getLocalSearchHierarchy(LocalizationType.COMMON_STATIC),
FILE_PATH, new String[] { FILE_EXT }, false, true);
List<SelectTimeRange> ranges = new ArrayList<SelectTimeRange>(
files.length);

View file

@ -60,7 +60,9 @@ import com.raytheon.viz.gfe.textformatter.CombinationsFileUtil.ComboData.Entry;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 25, 2008 mnash Initial creation
* Jul 25, 2008 mnash Initial creation
* Aug 07, 2013 1561 njensen Use pm.listFiles() instead of pm.listStaticFiles()
*
* </pre>
*
* @author mnash
@ -121,8 +123,9 @@ public class CombinationsFileUtil {
public static LocalizationFile[] getSavedCombos() {
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationFile[] combos = pm.listStaticFiles(SAVED_COMBO_DIR,
new String[] { ".xml" }, false, true);
LocalizationFile[] combos = pm.listFiles(
pm.getLocalSearchHierarchy(LocalizationType.CAVE_STATIC),
SAVED_COMBO_DIR, new String[] { ".xml" }, false, true);
return combos;
}

View file

@ -29,6 +29,7 @@ import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceData;
import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceID;
import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.LocalizationUtil;
import com.raytheon.uf.common.localization.PathManagerFactory;
@ -46,7 +47,8 @@ import com.raytheon.uf.common.util.FileUtil;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 24, 2012 dgilling Initial creation
* Jul 24, 2012 dgilling Initial creation
* Aug 07, 2013 1561 njensen Use pm.listFiles() instead of pm.listStaticFiles()
*
* </pre>
*
@ -78,9 +80,10 @@ public class ReferenceMgr {
*/
public ServerResponse<List<ReferenceID>> getInventory() {
List<ReferenceID> refIDs = new ArrayList<ReferenceID>();
LocalizationFile[] contents = PathManagerFactory.getPathManager()
.listStaticFiles(EDIT_AREAS_DIR, new String[] { ".xml" },
false, true);
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationFile[] contents = pm.listFiles(
pm.getLocalSearchHierarchy(LocalizationType.COMMON_STATIC),
EDIT_AREAS_DIR, new String[] { ".xml" }, false, true);
if (contents != null) {
for (LocalizationFile lf : contents) {
String s = LocalizationUtil.extractName(lf.getName());