perfsonar-dev - perfsonar: r4080 - in trunk/surfnet_java-flowsa-ma: conf src/main/java/org/perfsonar/service/measurementArchive/flowsa src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd
Subject: perfsonar development work
List archive
perfsonar: r4080 - in trunk/surfnet_java-flowsa-ma: conf src/main/java/org/perfsonar/service/measurementArchive/flowsa src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd
Chronological Thread
- From:
- To:
- Subject: perfsonar: r4080 - in trunk/surfnet_java-flowsa-ma: conf src/main/java/org/perfsonar/service/measurementArchive/flowsa src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd
- Date: Wed, 2 Jul 2008 05:37:27 -0400
Author: michael.bischoff
Date: 2008-07-02 05:37:27 -0400 (Wed, 02 Jul 2008)
New Revision: 4080
Modified:
trunk/surfnet_java-flowsa-ma/conf/service.properties
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/nfcapd/NfcapdControll.java
Log:
Temp checking so that gijs can rename the svn tree
Modified: trunk/surfnet_java-flowsa-ma/conf/service.properties
===================================================================
--- trunk/surfnet_java-flowsa-ma/conf/service.properties 2008-07-02
09:37:26 UTC (rev 4079)
+++ trunk/surfnet_java-flowsa-ma/conf/service.properties 2008-07-02
09:37:27 UTC (rev 4080)
@@ -39,63 +39,59 @@
service.ma.conf_file=config.xml
# === Flowsa specific properties ===
-# service.ma.flowsa.exporters - a number indicating the amount of different
sources
-# service.ma.flowsa.exporter1.hostname - required
-# service.ma.flowsa.exporter1.port - required
-# service.ma.flowsa.exporter1.description - optional
-# service.ma.flowsa.exporter1.flow-version - required
-# service.ma.flowsa.exporter1.sample-rate - required
-# service.ma.flowsa.exporter1.operating-system - optional
-# service.ma.flowsa.exporter1.location.institution - optional
-# service.ma.flowsa.exporter1.location.city - optional
-# service.ma.flowsa.exporter1.location.country - optional
-# service.ma.flowsa.exporter1.location.latitude - optional
-# service.ma.flowsa.exporter1.location.longitude - optional
-service.ma.flowsa.exporters=8
-service.ma.flowsa.exporter1.hostname=xsr01.asd001a.surf.net
-service.ma.flowsa.exporter1.port=29001
-service.ma.flowsa.exporter1.description=SURFnet6 Core Router Amsterdam1
-service.ma.flowsa.exporter1.flow-version=netflow_v9
-service.ma.flowsa.exporter1.sample-rate=100
-service.ma.flowsa.exporter2.hostname=xsr01.asd002a.surf.net
-service.ma.flowsa.exporter2.port=29003
-service.ma.flowsa.exporter2.description=SURFnet6 Core Router Amsterdam2
-service.ma.flowsa.exporter2.flow-version=netflow_v9
-service.ma.flowsa.exporter2.sample-rate=100
-service.ma.flowsa.exporter3.hostname=xsr03.asd001a.surf.net
-service.ma.flowsa.exporter3.port=29002
-service.ma.flowsa.exporter3.description=SURFnet6 Border Router Amsterdam1
-service.ma.flowsa.exporter3.flow-version=netflow_v9
-service.ma.flowsa.exporter3.sample-rate=100
-service.ma.flowsa.exporter4.hostname=xsr03.asd002a.surf.net
-service.ma.flowsa.exporter4.port=29004
-service.ma.flowsa.exporter4.description=SURFnet6 Border Router Amsterdam2
-service.ma.flowsa.exporter4.flow-version=netflow_v9
-service.ma.flowsa.exporter4.sample-rate=100
-service.ma.flowsa.exporter5.hostname=jnr01.asd001a.surf.net
-service.ma.flowsa.exporter5.port=27005
-service.ma.flowsa.exporter5.description=SURFnet6 Core Router Amsterdam1
-service.ma.flowsa.exporter5.flow-version=netflow_v9
-service.ma.flowsa.exporter5.sample-rate=100
-service.ma.flowsa.exporter6.hostname=jnr01.asd002a.surf.net
-service.ma.flowsa.exporter6.port=27007
-service.ma.flowsa.exporter6.description=SURFnet6 Core Router Amsterdam2
-service.ma.flowsa.exporter6.flow-version=netflow_v9
-service.ma.flowsa.exporter6.sample-rate=100
-service.ma.flowsa.exporter7.hostname=jnr02.asd001a.surf.net
-service.ma.flowsa.exporter7.port=27006
-service.ma.flowsa.exporter7.description=SURFnet6 Border Router Amsterdam1
-service.ma.flowsa.exporter7.flow-version=netflow_v9
-service.ma.flowsa.exporter7.sample-rate=100
-service.ma.flowsa.exporter8.hostname=jnr02.asd002a.surf.net
-service.ma.flowsa.exporter8.port=29008
-service.ma.flowsa.exporter8.description=SURFnet6 Border Router Amsterdam2
-service.ma.flowsa.exporter8.flow-version=netflow_v9
-service.ma.flowsa.exporter8.sample-rate=100
+# service.ma.flowsa.exporter.1.hostname - required
+# service.ma.flowsa.exporter.1.port - required
+# service.ma.flowsa.exporter.1.description - optional
+# service.ma.flowsa.exporter.1.flow-version - required
+# service.ma.flowsa.exporter.1.sample-rate - required
+# service.ma.flowsa.exporter.1.operating-system - optional
+# service.ma.flowsa.exporter.1.location.institution - optional
+# service.ma.flowsa.exporter.1.location.city - optional
+# service.ma.flowsa.exporter.1.location.country - optional
+# service.ma.flowsa.exporter.1.location.latitude - optional
+# service.ma.flowsa.exporter.1.location.longitude - optional
+service.ma.flowsa.exporter.1.hostname=xsr01.asd001a.surf.net
+service.ma.flowsa.exporter.1.port=29001
+service.ma.flowsa.exporter.1.description=SURFnet6 Core Router Amsterdam1
+service.ma.flowsa.exporter.1.flow-version=netflow_v9
+service.ma.flowsa.exporter.1.sample-rate=100
+service.ma.flowsa.exporter.2.hostname=xsr01.asd002a.surf.net
+service.ma.flowsa.exporter.2.port=29003
+service.ma.flowsa.exporter.2.description=SURFnet6 Core Router Amsterdam2
+service.ma.flowsa.exporter.2.flow-version=netflow_v9
+service.ma.flowsa.exporter.2.sample-rate=100
+service.ma.flowsa.exporter.3.hostname=xsr03.asd001a.surf.net
+service.ma.flowsa.exporter.3.port=29002
+service.ma.flowsa.exporter.3.description=SURFnet6 Border Router Amsterdam1
+service.ma.flowsa.exporter.3.flow-version=netflow_v9
+service.ma.flowsa.exporter.3.sample-rate=100
+service.ma.flowsa.exporter.4.hostname=xsr03.asd002a.surf.net
+service.ma.flowsa.exporter.4.port=29004
+service.ma.flowsa.exporter.4.description=SURFnet6 Border Router Amsterdam2
+service.ma.flowsa.exporter.4.flow-version=netflow_v9
+service.ma.flowsa.exporter.4.sample-rate=100
+service.ma.flowsa.exporter.5.hostname=jnr01.asd001a.surf.net
+service.ma.flowsa.exporter.5.port=27005
+service.ma.flowsa.exporter.5.description=SURFnet6 Core Router Amsterdam1
+service.ma.flowsa.exporter.5.flow-version=netflow_v9
+service.ma.flowsa.exporter.5.sample-rate=100
+service.ma.flowsa.exporter.6.hostname=jnr01.asd002a.surf.net
+service.ma.flowsa.exporter.6.port=27007
+service.ma.flowsa.exporter.6.description=SURFnet6 Core Router Amsterdam2
+service.ma.flowsa.exporter.6.flow-version=netflow_v9
+service.ma.flowsa.exporter.6.sample-rate=100
+service.ma.flowsa.exporter.7.hostname=jnr02.asd001a.surf.net
+service.ma.flowsa.exporter.7.port=27006
+service.ma.flowsa.exporter.7.description=SURFnet6 Border Router Amsterdam1
+service.ma.flowsa.exporter.7.flow-version=netflow_v9
+service.ma.flowsa.exporter.7.sample-rate=100
+service.ma.flowsa.exporter.8.hostname=jnr02.asd002a.surf.net
+service.ma.flowsa.exporter.8.port=29008
+service.ma.flowsa.exporter.8.description=SURFnet6 Border Router Amsterdam2
+service.ma.flowsa.exporter.8.flow-version=netflow_v9
+service.ma.flowsa.exporter.8.sample-rate=100
-
-
# --- query properties ---
# query.timeout - timeout/max execution time of a query (value is in seconds)
# query.max-results - if more then <value> results are encountered stop
processing
@@ -136,7 +132,7 @@
service.ma.flowsa.nfcapd.interval=5
# Group=Nfcapd properties
-# Description=interval between nfcapd writing a new file.
+# Description=nfcapd executable
service.ma.flowsa.nfcapd.location=/usr/bin/nfcapd
# Group=Nfcapd properties
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-07-02 09:37:26 UTC (rev 4079)
+++
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaMAServiceEngine.java
2008-07-02 09:37:27 UTC (rev 4080)
@@ -72,7 +72,7 @@
protected static final String SHOULDSTARTNFCAPDPROCESSES_PROPERTY_KEY
= "service.ma.flowsa.nfcapd.start-processes";
protected static final String NFCAPDINTERVAL_PROPERTY_KEY =
"service.ma.flowsa.nfcapd.interval";
protected static final String EXPORTERS_PROPERTY_KEY =
"service.ma.flowsa.exporters";
- protected static final String EXPORTER_PROPERTY_PART =
"service.ma.flowsa.exporter";
+ protected static final String EXPORTER_PROPERTY_PART =
"service.ma.flowsa.exporter.";
protected static final String EXPORTERHOST_PROPERTY_PART =
".hostname";
protected static final String EXPORTERPORT_PROPERTY_PART = ".port";
protected static final String EXPORTERDESCRIPTION_PROPERTY_PART =
".description";
@@ -415,28 +415,24 @@
* @param sourceDir
* @param source
* @return a set of exporters or null if exporters couldn't be located
+ * @throws PerfSONARException
*/
- private Set<Exporter> getExporters(File sourceDir,
ConfigurationComponent source) {
- int numberOfExporters;
- try {
- numberOfExporters =
Integer.parseInt(source.getProperty(EXPORTERS_PROPERTY_KEY));
- } catch (PerfSONARException e) {
- logger.warn("No configuration found: cannot proceed without a
value for exporters");
- return null;
- } catch (NumberFormatException e) {
- logger.warn("Bad configuration: value for exporters could not
be parsed.");
- return null;
- }
-
- Set<Exporter> exporters = new TreeSet<Exporter>();
- for(int i=1; i<=numberOfExporters; i++) {
+ private Set<Exporter> getExporters(File sourceDir,
ConfigurationComponent source) throws PerfSONARException {
+ Set<Exporter> exporters = new TreeSet<Exporter>();
+ for(int i = 0; ;i++) {
+ try {
+
configuration.getProperty(EXPORTER_PROPERTY_PART+i+".name");
+ } catch (PerfSONARException e) {
+ break;
+ }
+ logger.debug("FlowsaMAServiceEngine.getExporters:
found some information about an exporter with number "+i);
+
Exporter exporter = getExporter(i, sourceDir, source);
if(exporter!=null) {
exporters.add(exporter);
- } else {
- logger.info("FlowsaMAServiceEngine.getExporters:
could not create exporter "+i+".");
}
- }
+ }
+ if(exporters.isEmpty()) throw new PerfSONARException("No router
configuration found!");
return exporters;
}
private Exporter getExporter(int i, File sourceDir,
ConfigurationComponent source) {
Modified:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/NfcapdControll.java
===================================================================
---
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/NfcapdControll.java
2008-07-02 09:37:26 UTC (rev 4079)
+++
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/NfcapdControll.java
2008-07-02 09:37:27 UTC (rev 4080)
@@ -103,11 +103,13 @@
}
/**
+ * Retrieves the file data that contains data belonging to specified
parameters
+ * this method uses
{@link
#getExporterByHostName(String)}
* @param hostnames
* @param startTime
* @param endTime
* @return FileData
- * @throws IOException when it cannot read from an exporter because
it is ukown
+ * @throws IOException when it cannot read from an exporter because
it is unknown.
* @throws FileNotFoundException when one of the source files cannot
be found.
*/
public FileData getFileData(Collection<String> hostnames, Date
startTime, Date endTime) throws IOException, FileNotFoundException {
- perfsonar: r4080 - in trunk/surfnet_java-flowsa-ma: conf src/main/java/org/perfsonar/service/measurementArchive/flowsa src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd, svnlog, 07/02/2008
Archive powered by MHonArc 2.6.16.