[WIP] Upgrade ONOS to karaf version 4.2.1
Change-Id: I7cd40c995bdf1c80f94b1895fb3344e32404c7fa
diff --git a/apps/test/transaction-perf/src/main/java/org/onosproject/transactionperf/TransactionPerfApp.java b/apps/test/transaction-perf/src/main/java/org/onosproject/transactionperf/TransactionPerfApp.java
index c941bf6..45bdfd6 100644
--- a/apps/test/transaction-perf/src/main/java/org/onosproject/transactionperf/TransactionPerfApp.java
+++ b/apps/test/transaction-perf/src/main/java/org/onosproject/transactionperf/TransactionPerfApp.java
@@ -15,22 +15,6 @@
*/
package org.onosproject.transactionperf;
-import java.util.Comparator;
-import java.util.Dictionary;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Modified;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.apache.felix.scr.annotations.Service;
import org.onlab.util.Tools;
import org.onosproject.cfg.ComponentConfigService;
import org.onosproject.cluster.ClusterService;
@@ -42,29 +26,41 @@
import org.onosproject.store.service.TransactionContext;
import org.onosproject.store.service.TransactionalMap;
import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Modified;
+import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
+import java.util.Comparator;
+import java.util.Dictionary;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
import static com.google.common.base.Strings.isNullOrEmpty;
-import static org.apache.felix.scr.annotations.ReferenceCardinality.MANDATORY_UNARY;
import static org.onlab.util.Tools.get;
import static org.onlab.util.Tools.groupedThreads;
+import static org.osgi.service.component.annotations.ReferenceCardinality.MANDATORY;
import static org.slf4j.LoggerFactory.getLogger;
/**
* Application for measuring transaction performance.
*/
-@Component(immediate = true, enabled = true)
-@Service(value = TransactionPerfApp.class)
+@Component(immediate = true, service = TransactionPerfApp.class)
public class TransactionPerfApp {
private final Logger log = getLogger(getClass());
- @Reference(cardinality = MANDATORY_UNARY)
+ @Reference(cardinality = MANDATORY)
protected StorageService storageService;
- @Reference(cardinality = MANDATORY_UNARY)
+ @Reference(cardinality = MANDATORY)
protected ClusterService clusterService;
- @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+ @Reference(cardinality = MANDATORY)
protected ComponentConfigService configService;
private static final String DEFAULT_MAP_NAME = "transaction-perf";
@@ -75,28 +71,28 @@
private static final int DEFAULT_REPORT_INTERVAL_SECONDS = 1;
private static final String KEY_PREFIX = "key";
- @Property(name = "mapName", value = DEFAULT_MAP_NAME,
- label = "The name of the map to use for testing")
+ //@Property(name = "mapName", value = DEFAULT_MAP_NAME,
+ // label = "The name of the map to use for testing")
protected String mapName = DEFAULT_MAP_NAME;
- @Property(name = "readPercentage", doubleValue = DEFAULT_READ_PERCENTAGE,
- label = "Percentage of reads to perform")
+ //@Property(name = "readPercentage", doubleValue = DEFAULT_READ_PERCENTAGE,
+ // label = "Percentage of reads to perform")
protected double readPercentage = DEFAULT_READ_PERCENTAGE;
- @Property(name = "totalOperationsPerTransaction", intValue = DEFAULT_TOTAL_OPERATIONS,
- label = "Number of operations to perform within each transaction")
+ //@Property(name = "totalOperationsPerTransaction", intValue = DEFAULT_TOTAL_OPERATIONS,
+ // label = "Number of operations to perform within each transaction")
protected int totalOperationsPerTransaction = DEFAULT_TOTAL_OPERATIONS;
- @Property(name = "withContention", boolValue = DEFAULT_WITH_CONTENTION,
- label = "Whether to test transactions with contention from all nodes")
+ //@Property(name = "withContention", boolValue = DEFAULT_WITH_CONTENTION,
+ // label = "Whether to test transactions with contention from all nodes")
protected boolean withContention = DEFAULT_WITH_CONTENTION;
- @Property(name = "withRetries", boolValue = DEFAULT_WITH_RETRIES,
- label = "Whether to retry transactions until success")
+ //@Property(name = "withRetries", boolValue = DEFAULT_WITH_RETRIES,
+ // label = "Whether to retry transactions until success")
protected boolean withRetries = DEFAULT_WITH_RETRIES;
- @Property(name = "reportIntervalSeconds", intValue = DEFAULT_REPORT_INTERVAL_SECONDS,
- label = "The frequency with which to report performance in seconds")
+ //@Property(name = "reportIntervalSeconds", intValue = DEFAULT_REPORT_INTERVAL_SECONDS,
+ // label = "The frequency with which to report performance in seconds")
protected int reportIntervalSeconds = 1;
private ExecutorService testRunner =