Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r4016 - in trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa: . nfdump

Subject: perfsonar development work

List archive

perfsonar: r4016 - in trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa: . nfdump


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r4016 - in trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa: . nfdump
  • Date: Mon, 16 Jun 2008 14:09:50 -0400

Author: michael.bischoff
Date: 2008-06-16 14:09:50 -0400 (Mon, 16 Jun 2008)
New Revision: 4016

Modified:

trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaMAServiceEngine.java

trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpControll.java
Log:
fixed findbugs/pmd warnings

Modified:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaMAServiceEngine.java
===================================================================
---
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaMAServiceEngine.java
2008-06-16 18:07:18 UTC (rev 4015)
+++
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaMAServiceEngine.java
2008-06-16 18:09:50 UTC (rev 4016)
@@ -146,7 +146,7 @@
if(e.getCause() instanceof IllegalFilterException) {
throw new
PerfSONARException("error.ma.flowsa.fetching.filter","Filter was
illegal("+e.getLocalizedMessage()+")");
}
- if(e.getCause() instanceof
IllegalAggregationRuleException) {;
+ if(e.getCause() instanceof
IllegalAggregationRuleException) {
throw new
PerfSONARException("error.ma.flowsa.fetching.aggregationRule","Aggregation
rule was illegal("+e.getLocalizedMessage()+")");
}
throw new
PerfSONARException("error.ma.fetching","Exception while fetching data",e);
@@ -194,10 +194,10 @@
}
}
/**
- * @param flowsaGetRequest creates a query from the request and executes
it
+ * @param request creates a query from the request and executes it
* in nfdump, the result is put into a response or a exception is
* thrown
- * @return
+ * @return RawResponse
* @throws InterruptedException
* @throws ExecutionException
* @throws TimeoutException
@@ -225,7 +225,7 @@
* handles a Statistics request. creates a query from
* the request and executes it in nfdump, the result
* is put into a response or a exception is thrown
- * @param flowsaGetRequest
+ * @param request
* @return StatisticsResponse
* @throws InterruptedException
* @throws ExecutionException
@@ -267,7 +267,7 @@
* handles a TopFlowRequest. creates a query from
* the request and executes it in nfdump, the result
* is put into a response or a exception is thrown
- * @param flowsaGetRequest
+ * @param request
* @return a TopFlowResponse
* @throws InterruptedException
* @throws ExecutionException
@@ -298,7 +298,7 @@
return new TopFlowsResponse(request.getMetadata(), result);
}
/**
- * @return
+ * @return the newly created
{@link
NfdumpControll}
* @throws PerfSONARException
*/
protected NfdumpControll createNfdumpControll() throws
PerfSONARException {
@@ -334,8 +334,11 @@
if(!sourceDirectory.exists()) {
logger.warn("FlowsaMAServiceEngine.checkSource Source
directory doesn't exist trying to create.");
try {
- sourceDirectory.createNewFile();
-
logger.debug("FlowsaMAServiceEngine.checkSource Source directory created.");
+ if(sourceDirectory.createNewFile()) {
+
logger.debug("FlowsaMAServiceEngine.checkSource Source directory created.");
+ } else {
+
logger.debug("FlowsaMAServiceEngine.checkSource regardless of a earlier check
the file seems to exist now.");
+ }
} catch (IOException e) {

logger.error("FlowsaMAServiceEngine.checkSource Source directory couldn't be
created.");
throw new PerfSONARException(
@@ -411,7 +414,7 @@
* Get's the exporters from the configuration source. Checks access
to the specified source dir.
* @param sourceDir
* @param source
- * @return
+ * @return a set of exporters or null if exporters couldn't be located
*/
private Set<Exporter> getExporters(File sourceDir,
ConfigurationComponent source) {
int numberOfExporters;
@@ -585,7 +588,7 @@
}
/**
* gets the configuration component
- * @return
+ * @return a non-null ConfigurationComponent
* @throws PerfSONARException
*/
protected ConfigurationComponent getConfigurationComponent() throws
PerfSONARException {
@@ -601,7 +604,7 @@
}
/**
* get's the logger component
- * @return
+ * @return a non-null LoggerComponent
* @throws PerfSONARException
*/
protected LoggerComponent getLoggerComponent() throws
PerfSONARException {

Modified:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpControll.java
===================================================================
---
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpControll.java
2008-06-16 18:07:18 UTC (rev 4015)
+++
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpControll.java
2008-06-16 18:09:50 UTC (rev 4016)
@@ -416,22 +416,23 @@
}
@SuppressWarnings("null") // not smart enough to figure out the loop.
private String getDirectoryCommandFrom(NfdumpQuery query) throws
QueryException {
- String command = null;
+ StringBuilder command = new StringBuilder(32);
for(String directory : query.getDirectories()) {
- if(command == null) {
- command = directory;
+ if(command.length() == 0) {
+ command.append(directory);
continue;
}
String[] parts = directory.split("/");
if(parts.length==1) {
parts = directory.split("\\\\");
}
- command = command + ":" + parts[parts.length-1];
+ command.append(":");
+ command.append(parts[parts.length-1]);
}
- if(command == null) {
+ if(command.length() == 0) {
throw new QueryException("Query didn't contain any
directories to target");
}
- return command;
+ return command.toString();
}

}
\ No newline at end of file



  • perfsonar: r4016 - in trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa: . nfdump, svnlog, 06/16/2008

Archive powered by MHonArc 2.6.16.

Top of Page