Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2853 - in branches/new-structure/trunk/surfnet_java-flowsa-ma: . conf/axis-1.4/WEB-INF src/main/java/org/perfsonar/service/measurementArchive/flowsa src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/filters src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/rules

Subject: perfsonar development work

List archive

perfsonar: r2853 - in branches/new-structure/trunk/surfnet_java-flowsa-ma: . conf/axis-1.4/WEB-INF src/main/java/org/perfsonar/service/measurementArchive/flowsa src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/filters src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/rules


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2853 - in branches/new-structure/trunk/surfnet_java-flowsa-ma: . conf/axis-1.4/WEB-INF src/main/java/org/perfsonar/service/measurementArchive/flowsa src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/filters src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/rules
  • Date: Tue, 18 Sep 2007 19:12:49 -0400

Author: michael.bischoff
Date: 2007-09-18 19:12:49 -0400 (Tue, 18 Sep 2007)
New Revision: 2853

Added:

branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/package-info.java

branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/TooManyResultsException.java

branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/package-info.java

branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/rules/package-info.java
Modified:

branches/new-structure/trunk/surfnet_java-flowsa-ma/conf/axis-1.4/WEB-INF/server-config.wsdd
branches/new-structure/trunk/surfnet_java-flowsa-ma/pom.xml

branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/EventType.java

branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaGetRequest.java

branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaGetResponse.java

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

branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/Exporter.java

branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/NfcapdControll.java

branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpControll.java

branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/filters/package-info.java

branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/Nfdump152OutputReaderImpl.java

branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/package-info.java
Log:


Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/conf/axis-1.4/WEB-INF/server-config.wsdd
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/conf/axis-1.4/WEB-INF/server-config.wsdd
2007-09-16 20:00:38 UTC (rev 2852)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/conf/axis-1.4/WEB-INF/server-config.wsdd
2007-09-18 23:12:49 UTC (rev 2853)
@@ -5,9 +5,9 @@
<parameter name="enableNamespacePrefixOptimization" value="false"/>
<parameter name="dotNetSoapEncFix" value="true"/>
<parameter name="disablePrettyXML" value="true"/>
+ <parameter name="sendMultiRefs" value="true"/>
+ <parameter name="sendXsiTypes" value="true"/>
<parameter name="attachments.implementation"
value="org.apache.axis.attachments.AttachmentsImpl"/>
- <parameter name="sendXsiTypes" value="true"/>
- <parameter name="sendMultiRefs" value="true"/>
<parameter name="sendXMLDeclaration" value="true"/>
<requestFlow>
<handler type="java:org.apache.axis.handlers.JWSHandler">
@@ -19,16 +19,20 @@
</handler>
</requestFlow>
</globalConfiguration>
+ <handler name="soapmonitor"
type="java:org.apache.axis.handlers.SOAPMonitorHandler"/>
+ <handler name="LocalResponder"
type="java:org.apache.axis.transport.local.LocalResponder"/>
<handler name="URLMapper"
type="java:org.apache.axis.handlers.http.URLMapper"/>
- <handler name="LocalResponder"
type="java:org.apache.axis.transport.local.LocalResponder"/>
<handler name="Authenticate"
type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/>
- <handler name="soapmonitor"
type="java:org.apache.axis.handlers.SOAPMonitorHandler"/>
<service name="AdminService" provider="java:MSG">
<parameter name="allowedMethods" value="AdminService"/>
<parameter name="enableRemoteAdmin" value="false"/>
<parameter name="className" value="org.apache.axis.utils.Admin"/>
<namespace>http://xml.apache.org/axis/wsdd/</namespace>
</service>
+ <service name="Version" provider="java:RPC">
+ <parameter name="allowedMethods" value="getVersion"/>
+ <parameter name="className" value="org.apache.axis.Version"/>
+ </service>
<service name="FlowsaMeasurementArchiveService" provider="java:MSG"
style="message" use="literal">
<requestFlow>
<handler name="soapmonitor"
type="java:org.apache.axis.handlers.SOAPMonitorHandler"/>
@@ -42,10 +46,6 @@
http://perfsonar.org/services/measurementArchive
</namespace>
</service>
- <service name="Version" provider="java:RPC">
- <parameter name="allowedMethods" value="getVersion"/>
- <parameter name="className" value="org.apache.axis.Version"/>
- </service>
<transport name="http">
<requestFlow>
<handler type="URLMapper"/>

Modified: branches/new-structure/trunk/surfnet_java-flowsa-ma/pom.xml
===================================================================
--- branches/new-structure/trunk/surfnet_java-flowsa-ma/pom.xml 2007-09-16
20:00:38 UTC (rev 2852)
+++ branches/new-structure/trunk/surfnet_java-flowsa-ma/pom.xml 2007-09-18
23:12:49 UTC (rev 2853)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0";
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>
<modelVersion>4.0.0</modelVersion>
<groupId>perfsonar</groupId>
@@ -8,7 +8,10 @@
<packaging>war</packaging>
<name>Flowsa Measurement Archive</name>
<version>0.0.1</version>
- <description>Flow selection and aggregation Measurement Archive for
perfSONAR. For more information see the wiki-page.</description>
+ <description>
+ Flow selection and aggregation Measurement Archive for
+ perfSONAR. For more information see the wiki-page.
+ </description>
<url>

http://wiki.perfsonar.net/jra1-wiki/index.php/Flow_Selection_and_Aggregation_MA
</url>
@@ -48,7 +51,9 @@
</organization>
<build>
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
-
<testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
+ <testSourceDirectory>
+ ${basedir}/src/test/java
+ </testSourceDirectory>
<outputDirectory>${basedir}/bin</outputDirectory>
<directory>${basedir}/build</directory>
<plugins>
@@ -58,53 +63,62 @@
<source>1.5</source>
<target>1.5</target>
</configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <configuration>
- <container>
-
<containerId>tomcat5x</containerId>
- <type>remote</type>
- </container>
- <configuration>
- <type>runtime</type>
- <properties>
-
<cargo.tomcat.manager.url>http://${tomcatHostname}/manager/html</cargo.tomcat.manager.url>

-
<cargo.hostname>${tomcatHostname}</cargo.hostname>
-
<cargo.remote.username>${tomcatUsername}</cargo.remote.username>
-
<cargo.remote.password>${tomcatPassword}</cargo.remote.password>
- </properties>
- </configuration>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>Update
server-config.wsdd</id>
- <phase>process-classes</phase>
- <configuration>
- <tasks>
- <!-- update
server-config.wsdd -->
- <java
-
classname="org.apache.axis.utils.Admin" fork="true"
-
classpathref="maven.compile.classpath"
-
dir="${basedir}/conf/axis-1.4/WEB-INF/">
- <arg
value="server" />
- <arg
value="${basedir}/conf/wsdd/service-deploy.wsdd" />
- </java>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
</plugin>
<plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <configuration>
+ <container>
+
<containerId>tomcat5x</containerId>
+ <type>remote</type>
+ </container>
+ <configuration>
+ <type>runtime</type>
+ <properties>
+
<cargo.tomcat.manager.url>
+
http://${tomcatHostname}/manager/html
+
</cargo.tomcat.manager.url>
+ <cargo.hostname>
+
${tomcatHostname}
+ </cargo.hostname>
+
<cargo.remote.username>
+
${tomcatUsername}
+
</cargo.remote.username>
+
<cargo.remote.password>
+
${tomcatPassword}
+
</cargo.remote.password>
+ </properties>
+ </configuration>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>Update
server-config.wsdd</id>
+ <phase>process-classes</phase>
+ <configuration>
+ <tasks>
+ <!-- update
server-config.wsdd -->
+ <java
+
classname="org.apache.axis.utils.Admin" fork="true"
+
classpathref="maven.compile.classpath"
+
dir="${basedir}/conf/axis-1.4/WEB-INF/">
+ <arg
value="server" />
+ <arg
+
value="${basedir}/conf/wsdd/service-deploy.wsdd" />
+ </java>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-war-plugin</artifactId>
- <configuration>
+ <configuration>
<webResources>
<resource>
<directory>
@@ -113,28 +127,28 @@
<includes>

<include>**/*</include>
</includes>
- </resource>
- <resource>
-
<directory>${basedir}/conf/wsdd/</directory>
- <includes>
-
<include>**/*</include>
- </includes>
-
<targetPath>wsdd</targetPath>
- </resource>
- <resource>
-
<directory>${basedir}/conf/</directory>
- <includes>
-
<include>**/*</include>
- </includes>
- <excludes>
-
<exclude>axis-1.4/**/*</exclude>
-
<exclude>wsdd/**/*</exclude>
- </excludes>
- <!-- this should
really be changed to WEB-INF/conf -->
- <targetPath>
-
WEB-INF/classes/perfsonar/conf
- </targetPath>
</resource>
+ <resource>
+
<directory>${basedir}/conf/wsdd/</directory>
+ <includes>
+
<include>**/*</include>
+ </includes>
+
<targetPath>wsdd</targetPath>
+ </resource>
+ <resource>
+
<directory>${basedir}/conf/</directory>
+ <includes>
+
<include>**/*</include>
+ </includes>
+ <excludes>
+
<exclude>axis-1.4/**/*</exclude>
+
<exclude>wsdd/**/*</exclude>
+ </excludes>
+ <!-- this should
really be changed to WEB-INF/conf -->
+ <targetPath>
+
WEB-INF/classes/perfsonar/conf
+ </targetPath>
+ </resource>
</webResources>
<webXml>

${basedir}/conf/axis-1.4/WEB-INF/web.xml
@@ -143,13 +157,13 @@
</plugin>
</plugins>
</build>
- <repositories>
- <repository>
- <id>personar</id>
- <name>personar repository</name>
- <url>
-
http://anonsvn.internet2.edu/svn/perfsonar/trunk/jar-repository/
- </url>
+ <repositories>
+ <repository>
+ <id>personar</id>
+ <name>personar repository</name>
+ <url>
+
http://anonsvn.internet2.edu/svn/perfsonar/trunk/jar-repository/
+ </url>
</repository>
<repository>
<id>personar_leg</id>
@@ -169,7 +183,7 @@
<dependency>
<groupId>perfsonar</groupId>
<artifactId>perfsonar-base</artifactId>
- <version>1.0.20070814</version>
+ <version>1.0.20070911</version>
</dependency>
<dependency>
<groupId>nmwg</groupId>
@@ -199,7 +213,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.0</version>
+ <version>4.0</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -386,6 +400,20 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>taglist-maven-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>javancss-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <configuration>
+ <linkXref>true</linkXref>
+ <sourceEncoding>utf-8</sourceEncoding>
+ <minimumTokens>100</minimumTokens>
+ <targetJdk>1.5</targetJdk>
+ </configuration>
+ </plugin>
</plugins>
- </reporting>
+ </reporting>
</project>
\ No newline at end of file

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/EventType.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/EventType.java
2007-09-16 20:00:38 UTC (rev 2852)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/EventType.java
2007-09-18 23:12:49 UTC (rev 2853)
@@ -35,10 +35,17 @@

private final String name;

+ /**
+ * Creates an event type
+ * @param name the name of this EventType
+ */
EventType(String name) {
this.name = name;
}

+ /* (non-Javadoc)
+ * @see java.lang.Enum#toString()
+ */
@Override
public String toString() {
return name;

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaGetRequest.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaGetRequest.java
2007-09-16 20:00:38 UTC (rev 2852)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaGetRequest.java
2007-09-18 23:12:49 UTC (rev 2853)
@@ -22,11 +22,19 @@
import org.perfsonar.base.auxiliary.ComponentNames;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
+import org.perfsonar.service.base.engine.ActionType;
import
org.perfsonar.service.measurementArchive.flowsa.nfdump.AggegrationRule;
import org.perfsonar.service.measurementArchive.flowsa.nfdump.Filter;
import
org.perfsonar.service.measurementArchive.flowsa.nfdump.filters.SimpleFilter;
import
org.perfsonar.service.measurementArchive.flowsa.nfdump.rules.SimpleAggegrationRule;

+/**
+ * Class representing a GET request.
+ *
+ * @see ActionType.GET_DATA
+ * @author michael.bischoff
+ *
+ */
public class FlowsaGetRequest {

private static final String ISO8601_PATTERN =
"yyyy-MM-dd'T'HH:mm:ssZ";
@@ -40,6 +48,11 @@
private Date endTime;
private Integer topN;

+ /**
+ * Constructor that wraps around a Message.
+ * @param request
+ * @throws PerfSONARException
+ */
public FlowsaGetRequest(Message request) throws PerfSONARException {
this.request = request;
this.logger = FlowsaGetRequest.getLoggerComponent();
@@ -99,10 +112,18 @@
}
}

+ /**
+ * returns the EventType that belongs to this request
+ * @return the eventType
+ */
public EventType getEventType() {
return eventType;
}

+ /**
+ * returns the eventTypeValue that belongs to this request
+ * @return String containing the eventTypeValue
+ */
public String getEventTypeValue() {
return eventTypeValue;
}
@@ -126,6 +147,10 @@
}
}

+ /**
+ * returns the startTime contained in this request
+ * @return StartTime
+ */
public Date getStartTime() {
if (startTime == null) {
String value = parameters.get("startTime");
@@ -137,7 +162,7 @@
startTime = null;
}
}
- return endTime;
+ return startTime;
}

public Date getEndTime() {

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaGetResponse.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaGetResponse.java
2007-09-16 20:00:38 UTC (rev 2852)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaGetResponse.java
2007-09-18 23:12:49 UTC (rev 2853)
@@ -3,6 +3,11 @@
import org.ggf.ns.nmwg.base.v2_0.Message;
import org.ggf.ns.nmwg.base.v2_0.Metadata;

+/**
+ * base class for GetResponses send back from this Flowsa MA
+ * @author michael.bischoff
+ *
+ */
public class FlowsaGetResponse extends Message {

public FlowsaGetResponse(Metadata[] metadatas) {

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaMAServiceEngine.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaMAServiceEngine.java
2007-09-16 20:00:38 UTC (rev 2852)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaMAServiceEngine.java
2007-09-18 23:12:49 UTC (rev 2853)
@@ -25,6 +25,7 @@
import org.perfsonar.service.measurementArchive.flowsa.nfdump.RawFlowsQuery;
import org.perfsonar.service.measurementArchive.flowsa.nfdump.Statistics;
import
org.perfsonar.service.measurementArchive.flowsa.nfdump.StatisticsQuery;
+import
org.perfsonar.service.measurementArchive.flowsa.nfdump.TooManyResultsException;
import org.perfsonar.service.measurementArchive.flowsa.nfdump.TopDatum;
import org.perfsonar.service.measurementArchive.flowsa.nfdump.TopQuery;

@@ -105,6 +106,10 @@
logger.error("Fetching data was interrupted (" +
e.getLocalizedMessage() +")");
throw new
PerfSONARException("error.ma.fetching.interrupted","Fetching was
interrupted",e);
} catch (ExecutionException e) {
+ if(e.getCause() instanceof TooManyResultsException) {
+ logger.error("Exception while fetching, query
yielded too many results.");
+ throw new
PerfSONARException("error.ma.flowsa.fetching.too_many_results","Query yielded
too many results.");
+ }
logger.error("Exception while fetching(" +
e.getLocalizedMessage() +")");
throw new
PerfSONARException("error.ma.fetching","Exception while fetching data",e);
} catch (TimeoutException e) {

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/Exporter.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/Exporter.java
2007-09-16 20:00:38 UTC (rev 2852)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/Exporter.java
2007-09-18 23:12:49 UTC (rev 2853)
@@ -71,11 +71,14 @@
/**
* returns a filename that contains data from before time. the file
name
* returned is the filename of the file thats holds the newest data
before
- * time
+ * time. if there is no file before time it returns the first
encountered file
+ * after time.
* @param time
* @return filename
+ * TODO return null if last is null.
*/
public String getClosestFileBefore(Date time) {
+ if(time==null) throw new IllegalArgumentException("time
cannot be null");
if(myDirectory.exists()) {
String value = new
SimpleDateFormat("'nfcapd.'yyyyMMddHHmm").format(time);
String[] sortedFiles = myDirectory.list();
@@ -83,7 +86,10 @@
String last = null;
for(String file : sortedFiles) {

if(!(file.compareTo(value)<0)) {
- return last;
+ if(last!=null) {
+ return last;
+ }
+ return file;
}
last = file;
}
@@ -99,19 +105,19 @@
* @return filename
*/
public String getClosestFileAfter(Date time) {
+ String last = null;
if(myDirectory.exists()) {
String value = new
SimpleDateFormat("'nfcapd.'yyyyMMddHHmm").format(time);
String[] sortedFiles = myDirectory.list();
- Arrays.sort(sortedFiles);
- String last = null;
+ Arrays.sort(sortedFiles);
for(String file : sortedFiles) {

if(!(file.compareTo(value)<0)) {
- return last;
+ return file;
}
last = file;
}
}
- return null;
+ return last;
}

/**

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/NfcapdControll.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/NfcapdControll.java
2007-09-16 20:00:38 UTC (rev 2852)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/NfcapdControll.java
2007-09-18 23:12:49 UTC (rev 2853)
@@ -85,7 +85,7 @@

directories.add(exporter.getDirectory());
} else {
throw new
FileNotFoundException(
- "Data not
avail for interval"
+ "Data not
avail for specified interval"
);
}
} else {
@@ -93,7 +93,7 @@

directories.add(exporter.getDirectory());
} else {
throw new
FileNotFoundException(
- "Data not
avail for interval"
+ "Data not
avail for specified interval"
);
}
}

Added:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/package-info.java

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpControll.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpControll.java
2007-09-16 20:00:38 UTC (rev 2852)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpControll.java
2007-09-18 23:12:49 UTC (rev 2853)
@@ -142,7 +142,7 @@
while(( record = reader.readRecord()) != null) {
result.add(record);
if(result.size() > maxResults) {
- throw new QueryException("Query returned to many
results");
+ throw new TooManyResultsException(maxResults);
}
}
return result;
@@ -200,7 +200,7 @@
while(( record = reader.readTopDatum()) != null) {
result.add(record);
if(result.size() > maxResults) {
- throw new QueryException("Query returned to many
results");
+ throw new TooManyResultsException(maxResults);
}
}
return result;
@@ -338,8 +338,8 @@
*/
protected List<String> createCommandsFrom(TopQuery query) throws
QueryException {
List<String> commands = createCommandsForTopQuery();
- commands.add(TIME_FLAG);
- commands.add(query.getStartTime()+"-"+query.getEndTime());
+ commands.add(TIME_FLAG);
+ commands.add(getTimeCommandFrom(query));
commands.add("-s");
commands.add(query.getTopStatistic()+"/"+query.getOrderBy());

commands.add("-M");
@@ -358,7 +358,7 @@
return (NfdumpOutputReaderFactory) factoryClass.newInstance();
}

- private String getTimeCommandFrom(RawFlowsQuery query) {
+ private String getTimeCommandFrom(NfdumpQuery query) {
DateFormat nfdumpStyle = new SimpleDateFormat("yyyy/MM/dd.HH:mm:ss");
return
nfdumpStyle.format(query.getStartTime())+"-"+nfdumpStyle.format(query.getEndTime());
}

Added:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/TooManyResultsException.java

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/filters/package-info.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/filters/package-info.java
2007-09-16 20:00:38 UTC (rev 2852)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/filters/package-info.java
2007-09-18 23:12:49 UTC (rev 2853)
@@ -1,5 +1,4 @@
/**
- * $Id$
* Package that hosts filter Implementations
* @author Michael Bischoff
*/

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/Nfdump152OutputReaderImpl.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/Nfdump152OutputReaderImpl.java
2007-09-16 20:00:38 UTC (rev 2852)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/Nfdump152OutputReaderImpl.java
2007-09-18 23:12:49 UTC (rev 2853)
@@ -156,10 +156,51 @@
* @see
org.perfsonar.service.measurementArchive.flowsa.nfdump.NfdumpOutputReader#readTopData()
*/
public TopDatum readTopDatum() throws IOException {
- // TODO implement
- throw new IOException("Cannot read nfdump output: Number of Lines
did not match");
+ String line;
+ while((line = myReader.readLine()) != null) {
+ TopDatum datum = parseTopDatum(line);
+ if(datum!=null) {
+ return datum;
+ }
+ }
+ return null;
}

+ private TopDatum parseTopDatum(String line) throws IOException {
+ if(line.startsWith("Aggregated flows") ||
line.startsWith("Top 10 flows ordered by packets:")) {
+ return null;
+ }
+
+ String[] values = line.split("\\|",25);
+ if (values.length != 24) {
+ // hell.raise()
+ throw new IOException("Cannot read nfdump output: Line did not
sadisfy the right format.");
+ }
+
+ TopDatum datum = new TopDatum();
+
+// datum.setAdressFamily(values[0]);
+// datum.setTimeFirstSeen(values[1]);
+// datum.setMsecFirstSeen(values[2]);
+// datum.setTimeLastSeen(values[3]);
+// datum.setMsecLastSeen(values[4]);
+ datum.setProtocol(values[5]);
+// datum.setSourceAddress(values[6] + values[7] + values[8] +
values[9]);
+// datum.setSourcePort(values[10]);
+// datum.setDestinationAdress(values[11] + values[12] + values[13] +
values[14]);
+// datum.setDestinationPort(values[15]);
+// datum.setSourceAsNumber(values[16]);
+// datum.setDestinationAsNumber(values[17]);
+// datum.setInputInterface(values[18]);
+// datum.setOutputInterface(values[19]);
+// datum.setTcpFlag(values[20]);
+// datum.setTypeOfService(values[21]);
+ datum.setPackets(values[22]);
+ datum.setBytes(values[23]);
+
+ return datum;
+ }
+
private Flow parseRecord(String line) throws IOException {
String[] values = line.split("\\|", 25);


Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/package-info.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/package-info.java
2007-09-16 20:00:38 UTC (rev 2852)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/package-info.java
2007-09-18 23:12:49 UTC (rev 2853)
@@ -1,5 +1,4 @@
/**
- * $Id$
* Package that hosts OutputReader Implementations
* @see
org.perfsonar.service.measurementArchive.flowsa.nfdump.NfdumpOutputReaderFactory
* @see
org.perfsonar.service.measurementArchive.flowsa.nfdump.NfdumpOutputReader

Added:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/package-info.java

Added:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/rules/package-info.java



  • perfsonar: r2853 - in branches/new-structure/trunk/surfnet_java-flowsa-ma: . conf/axis-1.4/WEB-INF src/main/java/org/perfsonar/service/measurementArchive/flowsa src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/filters src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/rules, svnlog, 09/18/2007

Archive powered by MHonArc 2.6.16.

Top of Page