You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by ma...@apache.org on 2015/10/25 23:54:51 UTC
[11/12] oodt git commit: OODT-907 remove co
OODT-907 remove co
Project: http://git-wip-us.apache.org/repos/asf/oodt/repo
Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/7a5e0fa3
Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/7a5e0fa3
Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/7a5e0fa3
Branch: refs/heads/master
Commit: 7a5e0fa3a073f6e19bde14ed01c309eed3c37868
Parents: 4a50c60
Author: Tom Barber <to...@analytical-labs.com>
Authored: Sun Oct 25 22:45:39 2015 +0000
Committer: Tom Barber <to...@analytical-labs.com>
Committed: Sun Oct 25 22:45:39 2015 +0000
----------------------------------------------------------------------
.../oodt/cas/filemgr/browser/model/CasDB.java | 10 --
.../gui/perspective/build/BuildPerspective.java | 1 -
.../oodt/cas/filemgr/tools/CatalogSearch.java | 21 ++--
.../apache/oodt/cas/pushpull/daemon/Daemon.java | 122 +++++++++----------
.../runner/AsynchronousLocalEngineRunner.java | 1 -
5 files changed, 69 insertions(+), 86 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/oodt/blob/7a5e0fa3/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/CasDB.java
----------------------------------------------------------------------
diff --git a/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/CasDB.java b/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/CasDB.java
index 5d185c0..ca24c4f 100644
--- a/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/CasDB.java
+++ b/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/CasDB.java
@@ -26,7 +26,6 @@ import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
import org.apache.oodt.cas.metadata.Metadata;
import java.net.URL;
-import java.util.Hashtable;
import java.util.Vector;
public class CasDB {
@@ -120,10 +119,7 @@ public class CasDB {
if (products.size() < maxVal)
maxVal = products.size();
for (int i = 0; i < maxVal; i++) {
- Vector<Element> elements = (Vector<Element>) client
- .getElementsByProductType(type);
Metadata m = client.getMetadata(products.get(i));
- Hashtable hash = m.getHashtable();
results.addProduct(m);
}
} catch (Exception e) {
@@ -147,10 +143,7 @@ public class CasDB {
if (products.size() < maxVal)
maxVal = products.size();
for (int i = 0; i < maxVal; i++) {
- Vector<Element> elements = (Vector<Element>) client
- .getElementsByProductType(type);
Metadata m = client.getMetadata(products.get(i));
- Hashtable hash = m.getHashtable();
results.addProduct(m);
}
} catch (Exception e) {
@@ -169,10 +162,7 @@ public class CasDB {
if (products.size() < maxVal)
maxVal = products.size();
for (int i = 0; i < maxVal; i++) {
- Vector<Element> elements = (Vector<Element>) client
- .getElementsByProductType(type);
Metadata m = client.getMetadata(products.get(i));
- Hashtable hash = m.getHashtable();
results.addProduct(m);
}
} catch (Exception e) {
http://git-wip-us.apache.org/repos/asf/oodt/blob/7a5e0fa3/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/perspective/build/BuildPerspective.java
----------------------------------------------------------------------
diff --git a/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/perspective/build/BuildPerspective.java b/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/perspective/build/BuildPerspective.java
index 90c7d20..3209a3b 100644
--- a/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/perspective/build/BuildPerspective.java
+++ b/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/perspective/build/BuildPerspective.java
@@ -123,7 +123,6 @@ public class BuildPerspective extends MultiStatePerspective {
} else if (change instanceof ViewChange.REFRESH_VIEW) {
this.refresh();
} else if (change instanceof ViewChange.STATE_NAME_CHANGE) {
- ViewState state = ((ViewChange.STATE_NAME_CHANGE) change).getObject();
this.refresh();
} else if (change instanceof ViewChange.VIEW_MODEL) {
String modelId = ((ViewChange.VIEW_MODEL) change).getObject();
http://git-wip-us.apache.org/repos/asf/oodt/blob/7a5e0fa3/filemgr/src/main/java/org/apache/oodt/cas/filemgr/tools/CatalogSearch.java
----------------------------------------------------------------------
diff --git a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/tools/CatalogSearch.java b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/tools/CatalogSearch.java
index e766167..da2fe5a 100644
--- a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/tools/CatalogSearch.java
+++ b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/tools/CatalogSearch.java
@@ -18,6 +18,15 @@
package org.apache.oodt.cas.filemgr.tools;
//OODT imports
+import org.apache.lucene.index.Term;
+import org.apache.lucene.queryParser.ParseException;
+import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.PhraseQuery;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.RangeQuery;
+import org.apache.lucene.search.TermQuery;
import org.apache.oodt.cas.filemgr.structs.Element;
import org.apache.oodt.cas.filemgr.structs.Product;
import org.apache.oodt.cas.filemgr.structs.ProductType;
@@ -28,7 +37,6 @@ import org.apache.oodt.cas.filemgr.structs.exceptions.RepositoryManagerException
import org.apache.oodt.cas.filemgr.structs.exceptions.ValidationLayerException;
import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
-//JDK imports
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@@ -36,16 +44,8 @@ import java.net.URL;
import java.util.StringTokenizer;
import java.util.Vector;
+//JDK imports
//Lucene imports
-import org.apache.lucene.index.Term;
-import org.apache.lucene.queryParser.ParseException;
-import org.apache.lucene.queryParser.QueryParser;
-import org.apache.lucene.search.BooleanClause;
-import org.apache.lucene.search.BooleanQuery;
-import org.apache.lucene.search.PhraseQuery;
-import org.apache.lucene.search.Query;
-import org.apache.lucene.search.RangeQuery;
-import org.apache.lucene.search.TermQuery;
/**
*
@@ -348,7 +348,6 @@ public class CatalogSearch {
welcomeMessage += "Copyright 2006. California Institute of Technology.\n";
String usage = "CatalogSearch --url <url to File Manager service>\n";
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
- CatalogSearch cs = new CatalogSearch();
// determine url
for (int i = 0; i < args.length; i++) {
http://git-wip-us.apache.org/repos/asf/oodt/blob/7a5e0fa3/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/Daemon.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/Daemon.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/Daemon.java
index cee0373..661e242 100644
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/Daemon.java
+++ b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/Daemon.java
@@ -55,7 +55,7 @@ import javax.management.ObjectName;
* @author bfoster
*/
public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
- DaemonMBean {
+ DaemonMBean {
private static final long serialVersionUID = 7660972939723142802L;
@@ -115,8 +115,7 @@ public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
* @throws SecurityException
*/
public Daemon(int rmiRegPort, int daemonID, Config config,
- DaemonInfo daemonInfo, SiteInfo siteInfo) throws RemoteException,
- InstantiationException {
+ DaemonInfo daemonInfo, SiteInfo siteInfo) throws RemoteException {
super();
this.rmiRegPort = rmiRegPort;
@@ -134,20 +133,20 @@ public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
registerRMIServer();
} catch (Exception e) {
LOG.log(Level.SEVERE, "Failed to bind to RMI server : "
- + e.getMessage());
+ + e.getMessage());
}
try {
// registry CrawlDaemon as MBean so it can be used with jconsole
mbs = ManagementFactory.getPlatformMBeanServer();
ObjectName name = new ObjectName(
- "org.apache.oodt.cas.pushpull.daemon:type=Daemon"
- + this.getDaemonID());
+ "org.apache.oodt.cas.pushpull.daemon:type=Daemon"
+ + this.getDaemonID());
mbs.registerMBean(this, name);
} catch (Exception e) {
LOG.log(Level.SEVERE,
- "Failed to register CrawlDaemon as a MBean Object : "
- + e.getMessage());
+ "Failed to register CrawlDaemon as a MBean Object : "
+ + e.getMessage());
}
}
@@ -155,18 +154,17 @@ public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
return "Daemon" + this.getDaemonID();
}
- private void registerRMIServer() throws RemoteException,
- MalformedURLException, NotBoundException, AlreadyBoundException {
+ private void registerRMIServer() throws RemoteException {
try {
Naming.bind("//localhost:" + this.rmiRegPort + "/daemon"
- + this.getDaemonID(), this);
+ + this.getDaemonID(), this);
LOG.log(Level.INFO, "Created Daemon ID = " + this.getDaemonID()
- + " on RMI registry port " + this.rmiRegPort);
+ + " on RMI registry port " + this.rmiRegPort);
} catch (Exception e) {
e.printStackTrace();
throw new RemoteException("Failed to bind Daemon with ID = "
- + this.getDaemonID() + " to RMI registry at port "
- + this.rmiRegPort);
+ + this.getDaemonID() + " to RMI registry at port "
+ + this.rmiRegPort);
}
}
@@ -190,9 +188,9 @@ public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
// check if Daemon should sleep first
long timeTilNextRun;
if ((timeTilNextRun = Daemon.this.calculateTimeTilNextRun()) != 0
- && !(Daemon.this.beforeToday(daemonInfo
- .getFirstRunDateTime()) && daemonInfo
- .runOnReboot()))
+ && !(Daemon.this.beforeToday(daemonInfo
+ .getFirstRunDateTime()) && daemonInfo
+ .runOnReboot()))
sleep(timeTilNextRun);
for (keepRunning = true; keepRunning;) {
@@ -211,7 +209,7 @@ public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
try {
rs.retrieveFiles(daemonInfo.getPropFilesInfo(),
- daemonInfo.getDataFilesInfo());
+ daemonInfo.getDataFilesInfo());
} catch (Exception e) {
e.printStackTrace();
} finally {
@@ -224,15 +222,15 @@ public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
Daemon.this.notifyDaemonListenerOfFinish();
Daemon.this.calculateAndStoreElapsedTime(startTime);
if (Daemon.this.keepRunning
- && daemonInfo.getTimeIntervalInMilliseconds() >= 0) {
+ && daemonInfo.getTimeIntervalInMilliseconds() >= 0) {
sleep(Daemon.this.calculateTimeTilNextRun());
} else {
break;
}
}
LOG.log(Level.INFO, "Daemon with ID = "
- + Daemon.this.getDaemonID() + " on RMI registry port "
- + Daemon.this.rmiRegPort + " is shutting down");
+ + Daemon.this.getDaemonID() + " on RMI registry port "
+ + Daemon.this.rmiRegPort + " is shutting down");
Daemon.this.unregister();
}
}).start();
@@ -242,10 +240,10 @@ public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
try {
// unregister CrawlDaemon from RMI registry
Naming.unbind("//localhost:" + this.rmiRegPort + "/daemon"
- + this.getDaemonID());
+ + this.getDaemonID());
this.mbs.unregisterMBean(new ObjectName(
- "org.apache.oodt.cas.pushpull.daemon:type=Daemon"
- + this.getDaemonID()));
+ "org.apache.oodt.cas.pushpull.daemon:type=Daemon"
+ + this.getDaemonID()));
UnicastRemoteObject.unexportObject(this, true);
this.daemonListener.wasUnregisteredWith(this);
} catch (Exception e) {
@@ -270,10 +268,10 @@ public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
return 0;
} else {
int numOfPeriods = (int) (diff / daemonInfo
- .getTimeIntervalInMilliseconds());
+ .getTimeIntervalInMilliseconds());
long nextRunTime = gcStartDateTime.getTimeInMillis()
- + ((numOfPeriods + 1) * daemonInfo
- .getTimeIntervalInMilliseconds());
+ + ((numOfPeriods + 1) * daemonInfo
+ .getTimeIntervalInMilliseconds());
return nextRunTime - now.getTimeInMillis();
}
}
@@ -295,9 +293,9 @@ public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
private void sleep(long length) {
if (length > 0) {
LOG.log(Level.INFO, "Daemon with ID = " + this.getDaemonID()
- + " on RMI registry port " + this.rmiRegPort
- + " is going to sleep until "
- + new Date(System.currentTimeMillis() + length));
+ + " on RMI registry port " + this.rmiRegPort
+ + " is going to sleep until "
+ + new Date(System.currentTimeMillis() + length));
synchronized (this) {
try {
wait(length);
@@ -316,13 +314,13 @@ public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
public synchronized void pauseDaemon() {
try {
LOG.log(Level.INFO, "Daemon with ID = " + this.getDaemonID()
- + " on RMI registry port " + this.rmiRegPort
- + " has been stopped");
+ + " on RMI registry port " + this.rmiRegPort
+ + " has been stopped");
this.wait(0);
} catch (Exception e) {
}
LOG.log(Level.INFO, "Daemon with ID = " + this.getDaemonID()
- + " on RMI registry port " + this.rmiRegPort + " has resumed");
+ + " on RMI registry port " + this.rmiRegPort + " has resumed");
}
/**
@@ -390,24 +388,24 @@ public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
public String[] downloadedFilesInStagingArea() {
return this.daemonInfo.getDataFilesInfo().getDownloadInfo()
- .getStagingArea().list(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return !name.startsWith("Downloading_")
- && !(name.endsWith("info.tmp") || name
- .endsWith("cas"));
- }
- });
+ .getStagingArea().list(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return !name.startsWith("Downloading_")
+ && !(name.endsWith("info.tmp") || name
+ .endsWith("cas"));
+ }
+ });
}
public String[] downloadingFilesInStagingArea() {
return this.daemonInfo.getDataFilesInfo().getDownloadInfo()
- .getStagingArea().list(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.startsWith("Downloading_")
- && !(name.endsWith("info.tmp") || name
- .endsWith("cas"));
- }
- });
+ .getStagingArea().list(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return name.startsWith("Downloading_")
+ && !(name.endsWith("info.tmp") || name
+ .endsWith("cas"));
+ }
+ });
}
public int numberOfFilesDownloadingInStagingArea() {
@@ -440,36 +438,35 @@ public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
// ***************DataFilesInfo*******************
public String getDataFilesRemoteSite() {
RemoteSite remoteSite = this.daemonInfo.getDataFilesInfo()
- .getDownloadInfo().getRemoteSite();
+ .getDownloadInfo().getRemoteSite();
return (remoteSite == null) ? "" : remoteSite.toString();
}
public String getDataFilesRenamingConv() {
return this.daemonInfo.getDataFilesInfo().getDownloadInfo()
- .getRenamingConv();
+ .getRenamingConv();
}
public boolean getDeleteDataFilesFromServer() {
return this.daemonInfo.getDataFilesInfo().getDownloadInfo()
- .deleteFromServer();
+ .deleteFromServer();
}
public String getQueryMetadataElementName() {
String element = this.daemonInfo.getDataFilesInfo()
- .getQueryMetadataElementName();
+ .getQueryMetadataElementName();
if (element == null || element.equals(""))
- element = "Filename";
return this.daemonInfo.getDataFilesInfo().getQueryMetadataElementName();
}
public File getDataFilesStagingArea() {
return this.daemonInfo.getDataFilesInfo().getDownloadInfo()
- .getStagingArea();
+ .getStagingArea();
}
public boolean getAllowAliasOverride() {
return this.daemonInfo.getDataFilesInfo().getDownloadInfo()
- .isAllowAliasOverride();
+ .isAllowAliasOverride();
}
// **************DataFilesInfo********************
@@ -477,18 +474,18 @@ public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
// **************PropFilesInfo********************
public String getPropertyFilesRemoteSite() {
RemoteSite remoteSite = this.daemonInfo.getPropFilesInfo()
- .getDownloadInfo().getRemoteSite();
+ .getDownloadInfo().getRemoteSite();
return (remoteSite == null) ? "" : remoteSite.toString();
}
public String getPropertyFilesRenamingConv() {
return this.daemonInfo.getPropFilesInfo().getDownloadInfo()
- .getRenamingConv();
+ .getRenamingConv();
}
public boolean getDeletePropertyFilesFromServer() {
return this.daemonInfo.getPropFilesInfo().getDownloadInfo()
- .deleteFromServer();
+ .deleteFromServer();
}
public String getPropertyFilesOnSuccessDir() {
@@ -544,7 +541,6 @@ public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
if (args[i].equals("--rmiPort"))
rmiPort = Integer.parseInt(args[++i]);
else if (args[i].equals("--waitForNotification"))
- waitForCrawlNotification = true;
}
LocateRegistry.createRegistry(rmiPort);
@@ -553,16 +549,16 @@ public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
// registry CrawlDaemon as MBean so it can be used with jconsole
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
ObjectName name = new ObjectName(
- "org.apache.oodt.cas.pushpull.daemon:type=Daemon");
+ "org.apache.oodt.cas.pushpull.daemon:type=Daemon");
} catch (Exception e) {
LOG.log(Level.SEVERE,
- "Failed to register CrawlDaemon as a MBean Object : "
- + e.getMessage());
+ "Failed to register CrawlDaemon as a MBean Object : "
+ + e.getMessage());
}
} catch (Exception e) {
LOG.log(Level.SEVERE, "Failed to create CrawlDaemon : "
- + e.getMessage());
+ + e.getMessage());
} finally {
// terminate the CrawlDaemon
LOG.log(Level.INFO, "Terminating CrawlDaemon");
@@ -570,4 +566,4 @@ public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/oodt/blob/7a5e0fa3/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/AsynchronousLocalEngineRunner.java
----------------------------------------------------------------------
diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/AsynchronousLocalEngineRunner.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/AsynchronousLocalEngineRunner.java
index 77d82ee..1306685 100644
--- a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/AsynchronousLocalEngineRunner.java
+++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/AsynchronousLocalEngineRunner.java
@@ -134,7 +134,6 @@ public class AsynchronousLocalEngineRunner extends AbstractEngineRunnerBase {
for (Thread worker : this.workerMap.values())
if (worker != null) {
worker.interrupt();
- worker = null;
}
}