Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2808 - in branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa: . nfcapd nfdump nfdump/outputreaders

Subject: perfsonar development work

List archive

perfsonar: r2808 - in branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa: . nfcapd nfdump nfdump/outputreaders


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2808 - in branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa: . nfcapd nfdump nfdump/outputreaders
  • Date: Wed, 12 Sep 2007 04:19:27 -0400

Author: michael.bischoff
Date: 2007-09-12 04:19:26 -0400 (Wed, 12 Sep 2007)
New Revision: 2808

Added:

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

branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/TopData.java
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/FlowsaGetRequest.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/NMWGInterfaceBaseChaining.java

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

branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/TopFlowsResponse.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/NfdumpOutputReader.java

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

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

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

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

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

branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/Nfdump152OutputReaderImpl.java
Log:
topflows fixed.
smaller file selection scope.
time correctly implemented
time scope inplemented

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-11 12:01:30 UTC (rev 2807)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/EventType.java
2007-09-12 08:19:26 UTC (rev 2808)
@@ -1,7 +1,5 @@
package org.perfsonar.service.measurementArchive.flowsa;

-import org.perfsonar.service.measurementArchive.flowsa.EventType;
-
/**
* Enumeration of EventTypes for this flowsa MA
*

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-11 12:01:30 UTC (rev 2807)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaGetRequest.java
2007-09-12 08:19:26 UTC (rev 2808)
@@ -1,19 +1,20 @@
package org.perfsonar.service.measurementArchive.flowsa;

+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;

+import org.ggf.ns.nmwg.base.v2_0.Element;
import org.ggf.ns.nmwg.base.v2_0.Message;
import org.ggf.ns.nmwg.base.v2_0.Metadata;
import org.ggf.ns.nmwg.base.v2_0.Parameter;
import org.ggf.ns.nmwg.base.v2_0.Parameters;
+import org.ggf.ns.nmwg.time.v2_0.Time;
import org.ggf.ns.nmwg.tools.flow.v2_0.Subject;
import org.ggf.ns.nmwg.topology.base.v3_0.HostName;
import org.ggf.ns.nmwg.topology.base.v3_0.Node;
@@ -21,7 +22,6 @@
import org.perfsonar.base.auxiliary.ComponentNames;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
-import org.perfsonar.service.measurementArchive.flowsa.nfcapd.Exporter;
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;
@@ -29,12 +29,16 @@

public class FlowsaGetRequest {

+ private static final String ISO8601_PATTERN =
"yyyy-MM-dd'T'HH:mm:ssZ";
private final LoggerComponent logger;
private final Message request;
private EventType eventType;
private Node[] nodes;
private Map<String, String> parameters = new HashMap<String,String>();
private String eventTypeValue;
+ private Date startTime;
+ private Date endTime;
+ private Integer topN;

public FlowsaGetRequest(Message request) throws PerfSONARException {
this.request = request;
@@ -55,10 +59,24 @@
return;
}
for(Parameter parameter : parameters.getParameterArray()) {
-
this.parameters.put(parameter.getParameterName(),parameter.getParameterValue());
+ String name = parameter.getParameterName();
+ if("startTime".equals(name) ||
"endTime".equals(name)) {
+ processTimeParameter(parameter);
+ } else {
+
this.parameters.put(name,parameter.getParameterValue());
+ }
}
}

+ private void processTimeParameter(Parameter parameter) {
+ for(Element child : parameter.getChildArray()) {
+ if (child instanceof Time) {
+ Time time = (Time) child;
+ parameters.put(parameter.getParameterName(),
time.getValue());
+ }
+ }
+ }
+
private void processEventType(org.ggf.ns.nmwg.base.v2_0.EventType
eventType) {
if(eventType==null) {
return;
@@ -70,10 +88,7 @@

private void processSubject(org.ggf.ns.nmwg.base.v2_0.Subject
subject) {
if (subject instanceof Subject) {
- Subject flowSubject = (Subject) subject;
- if(flowSubject == null) {
- return;
- }
+ Subject flowSubject = (Subject) subject;

if(flowSubject.getNetwork()!=null) {
this.nodes =
flowSubject.getNetwork().getNodeArray();
}
@@ -108,13 +123,37 @@
}

public Date getStartTime() {
- // TODO implement time
- return null;
+ if(startTime==null) {
+ String value = parameters.get("startTime");
+ if(value.length()<19) {
+ logger.error("Could not parse DateTime.
(startTime)");
+ return null;
+ }
+ String dateTime = value.substring(0, 19);
+ //TODO time-zone.
+ DateFormat dateFormat = new
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
+ try {
+ startTime = dateFormat.parse(dateTime);
+ } catch (ParseException e) {
+ logger.error("Could not parse DateTime.
(startTime)");
+ startTime = null;
+ }
+ }
+ return startTime;
}

public Date getEndTime() {
- // TODO implement time
- return null;
+ if(endTime==null) {
+ String value = parameters.get("endTime");
+ DateFormat dateFormat = new
SimpleDateFormat(ISO8601_PATTERN);
+ try {
+ endTime = dateFormat.parse(value);
+ } catch (ParseException e) {
+ logger.error("Could not parse DateTime.
(endTime)");
+ endTime = null;
+ }
+ }
+ return endTime;
}

public Filter getFilter() {
@@ -126,8 +165,8 @@
}

public AggegrationRule getAggegrationRule() {
- String value = parameters.get("aggregationRule");
- if(value==null || value.equals("")) {
+ String value = parameters.get("aggregationRule");
+ if(value==null || value.equals("")) {
return null;
}
return new SimpleAggegrationRule(value) ;
@@ -149,22 +188,26 @@
}

public String getTopStatistic() {
- // TODO Auto-generated method stub
- return null;
+ return parameters.get("topStatistic");
}

public String getOrderBy() {
- // TODO Auto-generated method stub
- return null;
+ return parameters.get("orderBy");
}

- public boolean isSplittingProtocol() {
- // TODO Auto-generated method stub
- return false;
+ public boolean isSplittingProtocol() {
+ return parameters.get("splitProtocol").equals("yes");
}

public int getTopN() {
- // TODO Auto-generated method stub
- return 0;
+ if(topN==null) {
+ try {
+ topN = new Integer(parameters.get("topN"));
+ } catch (NumberFormatException e) {
+ logger.error("topN could not be parsed");
+ topN = Integer.valueOf(10);
+ }
+ }
+ return topN.intValue();
}
}

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-11 12:01:30 UTC (rev 2807)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaMAServiceEngine.java
2007-09-12 08:19:26 UTC (rev 2808)
@@ -1,11 +1,10 @@
package org.perfsonar.service.measurementArchive.flowsa;

import java.io.File;
+import java.io.FileNotFoundException;
import java.io.IOException;
-import java.util.Arrays;
import java.util.List;
import java.util.Set;
-import java.util.SortedSet;
import java.util.TreeSet;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
@@ -20,12 +19,13 @@
import org.perfsonar.service.base.engine.ServiceEngine;
import org.perfsonar.service.measurementArchive.flowsa.nfcapd.Exporter;
import org.perfsonar.service.measurementArchive.flowsa.nfcapd.NfcapdControll;
+import
org.perfsonar.service.measurementArchive.flowsa.nfcapd.NfcapdControll.FileData;
import org.perfsonar.service.measurementArchive.flowsa.nfdump.Flow;
import org.perfsonar.service.measurementArchive.flowsa.nfdump.NfdumpControll;
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.TopData;
+import org.perfsonar.service.measurementArchive.flowsa.nfdump.TopDatum;
import org.perfsonar.service.measurementArchive.flowsa.nfdump.TopQuery;

/**
@@ -53,7 +53,7 @@
protected static final String NFDUMPLOCATION_PROPERTY_KEY =
"service.ma.flowsa.nfdump.location";
protected static final String MAXRESULTS_PROPERTY_KEY =
"service.ma.flowsa.query.max-results";
protected static final String READERFACTORYCLASSNAME_PROPERTY_KEY =
"service.ma.flowsa.nfdump.ouputreader";
- protected static final String SOURCEDIRECTORY_PROPERTY_KEY =
"service.ma.flowsa.source";
+ protected static final String SOURCEDIRECTORY_PROPERTY_KEY =
"service.ma.flowsa.nfdump.source";
protected static final String SHOULDSTARTNFCAPDPROCESSES_PROPERTY_KEY
= "service.ma.flowsa.nfcapd.start-processes";
protected static final String EXPORTERS_PROPERTY_KEY =
"service.ma.flowsa.exporters";

@@ -72,7 +72,7 @@
*/
public FlowsaMAServiceEngine() throws PerfSONARException {
this.logger = getLoggerComponent();
- logger.debug("FlowsaMAServiceEngine.<Constructor> Creating...
FlowTypeMAServiceEngine.");
+ logger.debug("FlowsaMAServiceEngine.<Constructor> Creating...
FlowsaMAServiceEngine.");
this.configuration = getConfigurationComponent();
this.nfcapd = createNfcapdControll();
logger.debug("FlowsaMAServiceEngine.<Constructor> Successfully
created NfcapdControll.");
@@ -161,11 +161,14 @@
* @throws PerfSONARException
*/
protected RawFlowsResponse handleRawFlowRequest(FlowsaGetRequest
request) throws InterruptedException, ExecutionException, TimeoutException,
PerfSONARException {
- SortedSet<String> files = new TreeSet<String>();
- Set<String> directories = new TreeSet<String>();
- fillFilesAndDirectories(request, files, directories);
+ FileData fileData;
+ try {
+ fileData = nfcapd.getFileData(request.getHostNames(),
request.getStartTime(), request.getEndTime());
+ } catch (FileNotFoundException e) {
+ throw new PerfSONARException("error.ma.query","No
data avail for specified range");
+ }

- if(directories.size() == 0) {
+ if(fileData.empty()) {
throw new PerfSONARException("error.ma.query","Query didn't
contain a subject known by this MA");
}

@@ -174,9 +177,11 @@
request.getEndTime(),
request.getFilter(),
request.getAggegrationRule(),
- directories,
- files
+ fileData.getDirectories(),
+ fileData.getStartFile(),
+ fileData.getEndFile()
);
+
logger.debug("FlowsaMAServiceEngine.handleRawFlowRequest: Executing
query.");
List<Flow> result = nfdump.execute(query);
logger.debug("FlowsaMAServiceEngine.handleRawFlowRequest: Creating
response.");
@@ -194,20 +199,25 @@
* @throws PerfSONARException
*/
protected Message handleStatisticsFlowRequest(FlowsaGetRequest request)
throws InterruptedException, ExecutionException, TimeoutException,
PerfSONARException {
- SortedSet<String> files = new TreeSet<String>();
- Set<String> directories = new TreeSet<String>();
- fillFilesAndDirectories(request, files, directories);
+ FileData fileData;
+ try {
+ fileData = nfcapd.getFileData(request.getHostNames(),
request.getStartTime(), request.getEndTime());
+ } catch (FileNotFoundException e) {
+ throw new PerfSONARException("error.ma.query","No
data avail for specified range");
+ }

- if(directories.size() == 0) {
+ if(fileData.empty()) {
throw new PerfSONARException("error.ma.query","Query didn't
contain a subject known by this MA");
}

StatisticsQuery query = new StatisticsQuery(
request.getStartTime(),
request.getEndTime(),
- directories,
- files
+ fileData.getDirectories(),
+ fileData.getStartFile(),
+ fileData.getEndFile()
);
+
logger.debug("FlowsaMAServiceEngine.handleRawFlowRequest: Executing
query.");
Statistics result = nfdump.execute(query);
logger.debug("FlowsaMAServiceEngine.handleRawFlowRequest: Creating
response.");
@@ -226,11 +236,14 @@
* @throws PerfSONARException
*/
protected Message handleTopFlowRequest(FlowsaGetRequest request) throws
InterruptedException, ExecutionException, TimeoutException,
PerfSONARException {
- SortedSet<String> files = new TreeSet<String>();
- Set<String> directories = new TreeSet<String>();
- fillFilesAndDirectories(request, files, directories);
+ FileData fileData;
+ try {
+ fileData = nfcapd.getFileData(request.getHostNames(),
request.getStartTime(), request.getEndTime());
+ } catch (FileNotFoundException e) {
+ throw new PerfSONARException("error.ma.query","No
data avail for specified range");
+ }

- if(directories.size() == 0) {
+ if(fileData.empty()) {
throw new PerfSONARException("error.ma.query","Query didn't
contain a subject known by this MA");
}

@@ -239,15 +252,17 @@
request.getEndTime(),
request.getFilter(),
request.getAggegrationRule(),
- directories,
- files,
+ fileData.getDirectories(),
+ fileData.getStartFile(),
+ fileData.getEndFile(),
request.getTopStatistic(),
request.getOrderBy(),
request.isSplittingProtocol(),
request.getTopN()
);
+
logger.debug("FlowsaMAServiceEngine.handleTopFlowRequest: Executing
query.");
- List<TopData> result = nfdump.execute(query);
+ List<TopDatum> result = nfdump.execute(query);
logger.debug("FlowsaMAServiceEngine.handleTopFlowRequest: Creating
response.");
return new TopFlowsResponse(request.getMetadata(), result);
}
@@ -260,7 +275,7 @@
File nfdumpExecutable = getExecutableFrom(configuration);

if (!nfdumpExecutable.exists()) {
throw new PerfSONARException(
- "error.common.no_configuration",
+ "", //TODO errorcode
"Nfdump executable not found."
);
}
@@ -272,8 +287,8 @@
return new
NfdumpControll(nfdumpExecutable,readerFactoryClassName,maxResults,timeoutValue);
} catch (Exception e) {
throw new PerfSONARException(
- "error.common.no_configuration",
- "Nfdump executable not found.",
+ "", //TODO errorcode
+ "Couldn't create nfdump controll.",
e
);
}
@@ -300,30 +315,17 @@

boolean startNfcapdProcesses =
getShouldStartNfcapdProcesses(configuration);

- if(startNfcapdProcesses) {
- if(!sourceDirectory.canWrite()) {
- throw new PerfSONARException(
- "", //TODO error code
- "Can't write to source
directory."
- );
- }
+ if(startNfcapdProcesses && !sourceDirectory.canWrite()) {
+ throw new PerfSONARException(
+ "", //TODO error code
+ "Can't write to source directory."
+ );
}

Set<Exporter> exporters = getExporters(sourceDirectory,
configuration);

return new NfcapdControll(exporters, startNfcapdProcesses);
}
- private void fillFilesAndDirectories(FlowsaGetRequest request,
SortedSet<String> files, Set<String> directories) {
- for(String hostName : request.getHostNames()) {
- Exporter exporter =
nfcapd.getExporterByHostName(hostName);
- if(exporter!=null) {
-
files.addAll(Arrays.asList(exporter.getFileNames()));
- directories.add(exporter.getDirectory());
- } else {
- logger.error("No exporter with hostname:
"+hostName);
- }
- }
- }
/**
* looks up the property from the specified source. returns the
default value
* if the source didn't supply one.

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/NMWGInterfaceBaseChaining.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/NMWGInterfaceBaseChaining.java
2007-09-11 12:01:30 UTC (rev 2807)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/NMWGInterfaceBaseChaining.java
2007-09-12 08:19:26 UTC (rev 2808)
@@ -16,13 +16,14 @@
public class NMWGInterfaceBaseChaining extends BaseChaining {

/**
- * no arg constructor
+ * no-arg constructor
* @throws PerfSONARException
*/
public NMWGInterfaceBaseChaining() throws PerfSONARException {
super();
}

+ @Override
public void merge(Metadata in, Metadata other, Metadata out) {
out = in;
}

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/RawFlowsResponse.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/RawFlowsResponse.java
2007-09-11 12:01:30 UTC (rev 2807)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/RawFlowsResponse.java
2007-09-12 08:19:26 UTC (rev 2808)
@@ -9,11 +9,9 @@
import org.perfsonar.service.measurementArchive.flowsa.nfdump.Flow;

public class RawFlowsResponse extends FlowsaGetResponse {
- private final List<Flow> flows;

public RawFlowsResponse(Metadata[] metadatas, List<Flow> flows) {
super(metadatas);
- this.flows = flows;
setData(convertToData(flows));
}

@@ -50,8 +48,4 @@
return datum;
}

- public List<Flow> getFlows() {
- return flows;
- }
-
}

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/TopFlowsResponse.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/TopFlowsResponse.java
2007-09-11 12:01:30 UTC (rev 2807)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/TopFlowsResponse.java
2007-09-12 08:19:26 UTC (rev 2808)
@@ -1,15 +1,44 @@
package org.perfsonar.service.measurementArchive.flowsa;

+import java.util.Iterator;
import java.util.List;

+import org.ggf.ns.nmwg.base.v2_0.Data;
import org.ggf.ns.nmwg.base.v2_0.Metadata;
-import org.perfsonar.service.measurementArchive.flowsa.nfdump.TopData;
+import org.ggf.ns.nmwg.tools.flow.v2_0.Datum;
+import org.perfsonar.service.measurementArchive.flowsa.nfdump.TopDatum;

public class TopFlowsResponse extends FlowsaGetResponse {

- public TopFlowsResponse(Metadata[] metadata, List<TopData> result) {
+ public TopFlowsResponse(Metadata[] metadata, List<TopDatum> topData) {
super(metadata);
- // TODO Auto-generated constructor stub
+ setData(convertToData(topData));
}
-
+
+ private Data convertToData(List<TopDatum> topData) {
+ Data data = new Data();
+ data.setId("data1");
+ Iterator<TopDatum> iterator = topData.iterator();
+ while(iterator.hasNext()) {
+ data.addChild(convertToDatum(iterator.next()));
+ iterator.remove(); // free up resources.
+ }
+ return data;
+ }
+
+ private Datum convertToDatum(TopDatum element) {
+ Datum datum = new Datum();
+ datum.setBytes(element.getBytes());
+ datum.setBpp(element.getBytesPerPacket());
+ datum.setBps(element.getBytesPerSecond());
+ datum.setDateFirstSeen(element.getDateFirstSeen());
+ datum.setDuration(element.getDuration());
+ datum.setFlows(element.getFlows());
+ datum.setPackets(element.getPackets());
+ datum.setPps(element.getPacketsPerSecond());
+ datum.setProto(element.getProtocol());
+ datum.setTopStatistic(element.getTopStatistic());
+ return datum;
+ }
+
}

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-11 12:01:30 UTC (rev 2807)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/Exporter.java
2007-09-12 08:19:26 UTC (rev 2808)
@@ -1,12 +1,17 @@
package org.perfsonar.service.measurementArchive.flowsa.nfcapd;

import java.io.File;
+import java.text.SimpleDateFormat;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.SortedSet;
+import java.util.TreeSet;

/**
* Represents a Exporter, typically a router.
* @author Michael.Bischoff
*/
-public class Exporter {
+public class Exporter implements Comparable<Exporter> {

private final String hostName;
private final int port;
@@ -52,4 +57,73 @@
public int getPort() {
return port;
}
+
+ /**
+ * Compares this exporter to an other exporter as specified by
contract:
+ * @see java.lang.Comparable#compareTo(java.lang.Object)
+ * Exporters must have a unique hostName therefore comparing is done
+ * by comparing the hostName.
+ */
+ public int compareTo(Exporter other) {
+ return hostName.compareTo(other.hostName);
+ }
+
+ /**
+ * 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
+ * @param time
+ * @return filename
+ */
+ public String getClosestFileBefore(Date time) {
+ if(myDirectory.exists()) {
+ String value = new
SimpleDateFormat("'nfcapd.'yyyyMMddHHmm").format(time);
+ String[] sortedFiles = myDirectory.list();
+ Arrays.sort(sortedFiles);
+ String last = null;
+ for(String file : sortedFiles) {

+ if(!(file.compareTo(value)<0)) {
+ return last;
+ }
+ last = file;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * returns a filename that contains data from after time. the file
name
+ * returned is the filename of the file thats holds the oldest data
after
+ * time
+ * @param time
+ * @return filename
+ */
+ public String getClosestFileAfter(Date time) {
+ if(myDirectory.exists()) {
+ String value = new
SimpleDateFormat("'nfcapd.'yyyyMMddHHmm").format(time);
+ String[] sortedFiles = myDirectory.list();
+ Arrays.sort(sortedFiles);
+ String last = null;
+ for(String file : sortedFiles) {

+ if(!(file.compareTo(value)<0)) {
+ return last;
+ }
+ last = file;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * checks if it has both source files.
+ *
+ * TODO add check for files in between.
+ * @param startFile
+ * @param endFile
+ * @return
+ */
+ public boolean hasFiles(String startFile, String endFile) {
+ SortedSet<String> files = new
TreeSet<String>(Arrays.asList(myDirectory.list()));
+ return files.contains(startFile) && files.contains(endFile);
+ }
}

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-11 12:01:30 UTC (rev 2807)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/NfcapdControll.java
2007-09-12 08:19:26 UTC (rev 2808)
@@ -1,8 +1,54 @@
package org.perfsonar.service.measurementArchive.flowsa.nfcapd;

+import java.io.FileNotFoundException;
+import java.util.Collection;
+import java.util.Date;
import java.util.Set;
+import java.util.TreeSet;

public class NfcapdControll {
+ public static class FileData {
+
+ private String startFile;
+ private String endFile;
+ private Set<String> directories;
+
+ public FileData(String startFile, String endFile,Set<String>
directories) {
+ this.startFile = startFile;
+ this.endFile = endFile;
+ this.directories = directories;
+ }
+
+ public String getStartFile() {
+ return startFile;
+ }
+
+ public void setStartFile(String startFile) {
+ this.startFile = startFile;
+ }
+
+ public String getEndFile() {
+ return endFile;
+ }
+
+ public void setEndFile(String endFile) {
+ this.endFile = endFile;
+ }
+
+ public Set<String> getDirectories() {
+ return directories;
+ }
+
+ public void setDirectories(Set<String> directories) {
+ this.directories = directories;
+ }
+
+ public boolean empty() {
+ return directories.size() == 0;
+ }
+
+ }
+
private final Set<Exporter> exporters;
private final boolean startingNfcapdProcesses;

@@ -23,4 +69,38 @@
public boolean isStartingNfcapdProcesses() {
return startingNfcapdProcesses;
}
+
+ public FileData getFileData(Collection<String> hostnames, Date
startTime, Date endTime) throws FileNotFoundException {
+ String startFile = null;
+ String endFile = null;
+ Set<String> directories = new TreeSet<String>();
+
+ for(String hostName : hostnames) {
+ Exporter exporter = getExporterByHostName(hostName);
+ if(exporter!=null) {
+ if(startFile==null) {
+ startFile =
exporter.getClosestFileBefore(startTime);
+ endFile =
exporter.getClosestFileAfter(endTime);
+ if(startFile!=null) {
+
directories.add(exporter.getDirectory());
+ } else {
+ throw new
FileNotFoundException(
+ "Data not
avail for interval"
+ );
+ }
+ } else {
+ if(exporter.hasFiles(startFile,
endFile)) {
+
directories.add(exporter.getDirectory());
+ } else {
+ throw new
FileNotFoundException(
+ "Data not
avail for interval"
+ );
+ }
+ }
+
+ }
+ }
+
+ return new FileData(startFile,endFile,directories);
+ }
}

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-11 12:01:30 UTC (rev 2807)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpControll.java
2007-09-12 08:19:26 UTC (rev 2808)
@@ -4,6 +4,8 @@
import static java.util.concurrent.TimeUnit.SECONDS;

import java.io.File;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -26,15 +28,30 @@
*/
public class NfdumpControll {

+ /**
+ * Task to be submitted to the executor of this NfDumpControll. This
abstract task
+ * describes that a nfdump process should be started and calls the
abstract call method
+ * to allow specific implementation of sorting out the result.
+ * @author michael.bischoff
+ * @param <Type> Type of the result of this task
+ */
protected static abstract class NfdumpTask<Type> implements
Callable<Type> {
protected final List<String> commands;
protected final NfdumpOutputReaderFactory readerFactory;

+ /**
+ * Standard constructor
+ * @param commands commands to be passed on to nfdump.
+ * @param readerFactory factory to create the reader from.
+ */
public NfdumpTask(List<String> commands, NfdumpOutputReaderFactory
readerFactory) {
this.commands = Collections.unmodifiableList(commands);
this.readerFactory = readerFactory;
}

+ /* (non-Javadoc)
+ * @see java.util.concurrent.Callable#call()
+ */
public Type call() throws Exception {
Process process = null;
NfdumpOutputReader reader = null;
@@ -53,8 +70,15 @@
}
}

+ /**
+ * method that should call the reader and return the result of this
task
+ * @param reader created by the supplied readerFactory
+ * @return Result of this task
+ * @throws Exception to allow exceptions to be wrapped in a
{@link
ExecutionException} lateron.
+ */
abstract Type call(NfdumpOutputReader reader) throws Exception;
}
+
private final NfdumpOutputReaderFactory readerFactory;
private final File nfdumpExecutable;
private final ExecutorService executorService =
Executors.newCachedThreadPool(new MyThreadFactory());
@@ -63,6 +87,7 @@
private final static String TIME_FLAG = "-t";
private final static String QUIET_FLAG = "-q";
private final static String STATISTICS_FLAG = "-I";
+ private final static String MAX_RACORDS_FLAG = "-c";

final int maxResults;
final long timeoutValue;
@@ -115,10 +140,10 @@
List<Flow> result = new ArrayList<Flow>();
Flow record = null;
while(( record = reader.readRecord()) != null) {
+ result.add(record);
if(result.size() > maxResults) {
throw new QueryException("Query returned to many
results");
}
- result.add(record);
}
return result;
}
@@ -130,9 +155,9 @@
* This method takes a StatisticsQuery, executes it and returns the
result.
* @param query to be executed
* @return Statistics
- * @throws InterruptedException wenn waiting for timeout was interrupted
- * @throws ExecutionException wenn something went wrong executing the
query-task
- * @throws TimeoutException wenn the query-task took too long
+ * @throws InterruptedException when waiting for timeout was interrupted
+ * @throws ExecutionException when something went wrong executing the
query-task
+ * @throws TimeoutException when the query-task took too long
*/
public Statistics execute(StatisticsQuery query) throws
InterruptedException, ExecutionException, TimeoutException {
List<String> commands;
@@ -159,13 +184,26 @@
* @throws ExecutionException when something went wrong executing the
query-task
* @throws TimeoutException when the query-task took too long
*/
- public List<TopData> execute(TopQuery query) throws
InterruptedException, ExecutionException, TimeoutException {
- List<String> commands = createCommandsFrom(query);
- Callable<List<TopData>> task = new
NfdumpTask<List<TopData>>(commands,readerFactory) {
+ public List<TopDatum> execute(TopQuery query) throws
InterruptedException, ExecutionException, TimeoutException {
+ List<String> commands;
+ try {
+ commands = createCommandsFrom(query);
+ } catch (QueryException e) {
+ throw new ExecutionException(e);
+ }
+
+ Callable<List<TopDatum>> task = new
NfdumpTask<List<TopDatum>>(commands,readerFactory) {
@Override
- public List<TopData> call(NfdumpOutputReader reader) throws
Exception {
- // TODO implements task for Topdata
- throw new UnsupportedOperationException("not
implemented");//reader.readTopData();
+ public List<TopDatum> call(NfdumpOutputReader reader) throws
Exception {
+ List<TopDatum> result = new ArrayList<TopDatum>();
+ TopDatum record = null;
+ while(( record = reader.readTopDatum()) != null) {
+ result.add(record);
+ if(result.size() > maxResults) {
+ throw new QueryException("Query returned to many
results");
+ }
+ }
+ return result;
}
};
return submit(task);
@@ -189,26 +227,28 @@
}
}
/**
- * convenience method for creating a command list for processbuilder this
- * method creates one for a retrieving nfdump flowrecords
+ * convenience method for creating a command list for ProcessBuilder this
+ * method creates one for a retrieving nfdump flow records
*
* @return a List of commands(String) that can be passed onto a
- * Processbuilder
+ * ProcessBuilder
*/
- protected List<String> createCommandsForRecordQuery() {
+ protected List<String> createCommandsForRawQuery() {
List<String> commands = new ArrayList<String>();
commands.add(nfdumpExecutable.getAbsolutePath());
commands.add(FORMAT_FLAG);
commands.add(FORMAT_FLAG_VALUE);
commands.add(QUIET_FLAG);
+ commands.add(MAX_RACORDS_FLAG);
+ commands.add(String.valueOf(maxResults+1));
return commands;
}
/**
- * convenience method for creating a command list for processbuilder this
+ * convenience method for creating a command list for ProcessBuilder this
* method creates one for a retrieving nfdump statistics
*
* @return a List of commands(String) that can be passed onto a
- * Processbuilder
+ * ProcessBuilder
*/
protected List<String> createCommandsForStatisticQuery() {
List<String> commands = new ArrayList<String>();
@@ -217,25 +257,43 @@
return commands;
}
/**
- * convenience method for creating a command list for processbuilder this
+ * convenience method for creating a command list for ProcessBuilder this
+ * method creates one for a retrieving nfdump TopData
+ *
+ * @return a List of commands(String) that can be passed onto a
+ * ProcessBuilder
+ */
+ protected List<String> createCommandsForTopQuery() {
+ List<String> commands = new ArrayList<String>();
+ commands.add(nfdumpExecutable.getAbsolutePath());
+ commands.add(FORMAT_FLAG);
+ commands.add(FORMAT_FLAG_VALUE);
+ commands.add(QUIET_FLAG);
+ commands.add(MAX_RACORDS_FLAG);
+ commands.add(String.valueOf(maxResults+1));
+ return commands;
+ }
+ /**
+ * convenience method for creating a command list for ProcessBuilder this
* method creates one based upon a RecordQuery takes a
- *
{@link
#createCommandsForRecordQuery()} as a base
+ *
{@link
#createCommandsForRawQuery()} as a base
*
* @param query
* to be converted
* @return a List of commands(String) that can be passed onto a
- * Processbuilder
+ * ProcessBuilder
* @throws QueryException
* @see RawFlowsQuery
*/
protected List<String> createCommandsFrom(RawFlowsQuery query) throws
QueryException {
- List<String> commands = createCommandsForRecordQuery();
- //commands.add(TIME_FLAG);
-
+ List<String> commands = createCommandsForRawQuery();
+ commands.add(TIME_FLAG);
+ commands.add(getTimeCommandFrom(query));
commands.add("-M");
commands.add(getDirectoryCommandFrom(query));
commands.add("-R");
- commands.add(".");
+ commands.add(query.getStartFile()+":"+query.getEndFile());
+
if (query.getAggegrationRule() != null ) {
commands.add("-A");
commands.add(query.getAggegrationRule().getExpression());
@@ -247,54 +305,65 @@
return commands;
}
/**
- * convenience method for creating a command list for processbuilder this
+ * convenience method for creating a command list for ProcessBuilder this
* method creates one based upon a StatisticsQuery takes
*
{@link
#createCommandsForStatisticQuery()} as a base
*
* @param query
* to be converted
* @return a List of commands(String) that can be passed onto a
- * Processbuilder
+ * ProcessBuilder
* @throws QueryException
* @see StatisticsQuery
*/
protected List<String> createCommandsFrom(StatisticsQuery query) throws
QueryException {
List<String> commands = createCommandsForStatisticQuery();
- //commands.add(TIME_FLAG);
-
commands.add("-M");
commands.add(getDirectoryCommandFrom(query));
commands.add("-R");
- commands.add(".");
-
+ commands.add(query.getStartFile()+":"+query.getEndFile());
return commands;
}
/**
- * convenience method for creating a command list for processbuilder this
+ * convenience method for creating a command list for ProcessBuilder this
* method creates one based upon a TopQuery takes
*
{@link
#createCommandsForStatisticQuery()} as a base
*
* @param query
* to be converted
* @return a List of commands(String) that can be passed onto a
- * Processbuilder
+ * ProcessBuilder
+ * @throws QueryException
* @see StatisticsQuery
*/
- protected List<String> createCommandsFrom(TopQuery query) {
- // TODO Auto-generated method stub
- return null;
+ protected List<String> createCommandsFrom(TopQuery query) throws
QueryException {
+ List<String> commands = createCommandsForTopQuery();
+ commands.add(TIME_FLAG);
+ commands.add(query.getStartTime()+"-"+query.getEndTime());
+ commands.add("-s");
+ commands.add(query.getTopStatistic()+"/"+query.getOrderBy());

+ commands.add("-M");
+ commands.add(getDirectoryCommandFrom(query));
+ commands.add("-R");
+ commands.add(query.getStartFile()+":"+query.getEndFile());
+ return commands;
}

- private NfdumpOutputReaderFactory configureOutputFactory(String
className) throws InstantiationException, IllegalAccessException,
ClassNotFoundException {
+ private NfdumpOutputReaderFactory configureOutputFactory(String
className) throws InstantiationException, IllegalAccessException,
ClassNotFoundException {
// default, convention over configuration
if(className == null) {
return new Nfdump152OutputReaderFactory();
}
- Class factoryClass = Class.forName(className);
+ Class<?> factoryClass = Class.forName(className);
return (NfdumpOutputReaderFactory) factoryClass.newInstance();
}

- private String getDirectoryCommandFrom(NfdumpQuery query) throws
QueryException {
+ private String getTimeCommandFrom(RawFlowsQuery query) {
+ DateFormat nfdumpStyle = new SimpleDateFormat("yyyy/MM/dd.HH:mm:ss");
+ return
nfdumpStyle.format(query.getStartTime())+"-"+nfdumpStyle.format(query.getEndTime());
+ }
+ @SuppressWarnings("null") // not smart enough to figure out the loop.
+ private String getDirectoryCommandFrom(NfdumpQuery query) throws
QueryException {
String command = null;
for(String directory : query.getDirectories()) {
if(command == null) {
@@ -314,13 +383,13 @@
}

/**
- * Mostly unimporant class, it simply ensures that the thread priority
is not
+ * Mostly unimportant class, it simply ensures that the thread priority
is not
* higher than the thread that initiated. It also sets names so that
when
* profiling/debugging threads are recognizable.
* @author Michael Bischoff
*/
private static final class MyThreadFactory implements ThreadFactory {
- private ThreadGroup threadGroup;
+ private final ThreadGroup threadGroup;
private int i = 0;

protected MyThreadFactory() {

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpOutputReader.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpOutputReader.java
2007-09-11 12:01:30 UTC (rev 2807)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpOutputReader.java
2007-09-12 08:19:26 UTC (rev 2808)
@@ -38,7 +38,7 @@
* @return
* @throws IOException
*/
- public TopData readTopData() throws IOException;
+ public TopDatum readTopDatum() throws IOException;

/**
* Method to allow the reader to clean up resources such as

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpQuery.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpQuery.java
2007-09-11 12:01:30 UTC (rev 2807)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpQuery.java
2007-09-12 08:19:26 UTC (rev 2808)
@@ -2,7 +2,6 @@

import java.util.Date;
import java.util.Set;
-import java.util.SortedSet;

/**
* A abstract representation of a query for nfdump
@@ -13,18 +12,20 @@
public abstract class NfdumpQuery {

private Set<String> directories;
- private Set<String> files;
private Date startTime;
private Date endTime;
+ private String startFile;
+ private String endFile;

public NfdumpQuery() {
/* default no arg constructor */
}
- public NfdumpQuery(Date startTime, Date endTime, Set<String>
directories, SortedSet<String> files) {
+ public NfdumpQuery(Date startTime, Date endTime, Set<String>
directories, String startFile, String endFile) {
this.startTime = startTime;
this.endTime = endTime;
this.directories = directories;
- this.files = files;
+ this.startFile = startFile;
+ this.endFile = endFile;
}
public Date getEndTime() {
return endTime;
@@ -44,10 +45,13 @@
public void setDirectories(Set<String> directories) {
this.directories = directories;
}
- public Set<String> getFiles() {
- return files;
+ public String getEndFile() {
+ return endFile;
}
- public void setFiles(Set<String> files) {
- this.files = files;
+ public String getStartFile() {
+ return startFile;
}
+ public void setEndFile(String endFile) {
+ this.endFile = endFile;
+ }
}
\ No newline at end of file

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/RawFlowsQuery.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/RawFlowsQuery.java
2007-09-11 12:01:30 UTC (rev 2807)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/RawFlowsQuery.java
2007-09-12 08:19:26 UTC (rev 2808)
@@ -2,7 +2,6 @@

import java.util.Date;
import java.util.Set;
-import java.util.SortedSet;

/**
* Rawflows implementation of a
{@link
NfdumpQuery}
@@ -20,8 +19,8 @@
}

public RawFlowsQuery(Date startTime, Date endTime, Filter filter,
- AggegrationRule aggegrationRule, Set<String> directories,
SortedSet<String> files) {
- super(startTime,endTime,directories,files);
+ AggegrationRule aggegrationRule, Set<String> directories, String
startFile, String endFile) {
+ super(startTime,endTime,directories,startFile,endFile);
this.filter = filter;
this.aggegrationRule = aggegrationRule;
}

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/StatisticsQuery.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/StatisticsQuery.java
2007-09-11 12:01:30 UTC (rev 2807)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/StatisticsQuery.java
2007-09-12 08:19:26 UTC (rev 2808)
@@ -2,7 +2,6 @@

import java.util.Date;
import java.util.Set;
-import java.util.SortedSet;

/**
* An implementation of
{@link
NfdumpQuery} for Statistics
@@ -11,7 +10,7 @@
* @version $id$
*/
public class StatisticsQuery extends NfdumpQuery {
- public StatisticsQuery(Date startTime, Date endTime, Set<String>
directories,SortedSet<String> files) {
- super(startTime, endTime, directories, files);
+ public StatisticsQuery(Date startTime, Date endTime, Set<String>
directories, String startFile, String endFile) {
+ super(startTime, endTime, directories, startFile, endFile);
}
}

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

Copied:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/TopDatum.java
(from rev 2798,
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/TopData.java)

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/TopQuery.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/TopQuery.java
2007-09-11 12:01:30 UTC (rev 2807)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/TopQuery.java
2007-09-12 08:19:26 UTC (rev 2808)
@@ -2,7 +2,6 @@

import java.util.Date;
import java.util.Set;
-import java.util.SortedSet;

/**
* A implementation of
{@link
NfdumpQuery} for Top data
@@ -20,9 +19,9 @@
private int topN;

public TopQuery(Date startTime, Date endTime, Filter filter,
- AggegrationRule aggegrationRule, Set<String>
directories,SortedSet<String> files,
+ AggegrationRule aggegrationRule, Set<String> directories, String
startFile, String endFile,
String topStatistic, String orderBy, boolean splitProtocol, int
topN) {
- super(startTime, endTime, directories, files);
+ super(startTime, endTime, directories, startFile, endFile);
this.filter = filter;
this.aggegrationRule = aggegrationRule;
this.topStatistic = topStatistic;

Modified:
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/Nfdump152OutputReaderFactory.java
===================================================================
---
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/Nfdump152OutputReaderFactory.java
2007-09-11 12:01:30 UTC (rev 2807)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/Nfdump152OutputReaderFactory.java
2007-09-12 08:19:26 UTC (rev 2808)
@@ -21,6 +21,7 @@
* no arg constructor
*/
public Nfdump152OutputReaderFactory() {
+ /* no arg constructor for reflective creation */
}

/**

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-11 12:01:30 UTC (rev 2807)
+++
branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/Nfdump152OutputReaderImpl.java
2007-09-12 08:19:26 UTC (rev 2808)
@@ -8,7 +8,7 @@
import org.perfsonar.service.measurementArchive.flowsa.nfdump.Flow;
import
org.perfsonar.service.measurementArchive.flowsa.nfdump.NfdumpOutputReader;
import org.perfsonar.service.measurementArchive.flowsa.nfdump.Statistics;
-import org.perfsonar.service.measurementArchive.flowsa.nfdump.TopData;
+import org.perfsonar.service.measurementArchive.flowsa.nfdump.TopDatum;


/**
@@ -155,7 +155,7 @@
/* (non-Javadoc)
* @see
org.perfsonar.service.measurementArchive.flowsa.nfdump.NfdumpOutputReader#readTopData()
*/
- public TopData readTopData() throws IOException {
+ public TopDatum readTopDatum() throws IOException {
// TODO implement
throw new IOException("Cannot read nfdump output: Number of Lines
did not match");
}



  • perfsonar: r2808 - in branches/new-structure/trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa: . nfcapd nfdump nfdump/outputreaders, svnlog, 09/12/2007

Archive powered by MHonArc 2.6.16.

Top of Page