Search in sources :

Example 11 with MeterTableKey

use of org.onosproject.net.meter.MeterTableKey in project onos by opennetworkinglab.

the class DistributedMeterStore method storeMeterFeatures.

@Override
public MeterStoreResult storeMeterFeatures(MeterFeatures meterfeatures) {
    // Store meter features, this is done once for each features of every device
    MeterStoreResult result = MeterStoreResult.success();
    MeterTableKey key = MeterTableKey.key(meterfeatures.deviceId(), meterfeatures.scope());
    try {
        metersFeatures.put(key, meterfeatures);
    } catch (StorageException e) {
        log.error("{} thrown a storage exception: {}", e.getStackTrace()[0].getMethodName(), e.getMessage(), e);
        result = MeterStoreResult.fail(TIMEOUT);
    }
    return result;
}
Also used : MeterStoreResult(org.onosproject.net.meter.MeterStoreResult) MeterTableKey(org.onosproject.net.meter.MeterTableKey) StorageException(org.onosproject.store.service.StorageException)

Aggregations

MeterTableKey (org.onosproject.net.meter.MeterTableKey)11 PiMeterCellId (org.onosproject.net.pi.runtime.PiMeterCellId)4 StorageException (org.onosproject.store.service.StorageException)4 DefaultMeterFeatures (org.onosproject.net.meter.DefaultMeterFeatures)3 MeterFeatures (org.onosproject.net.meter.MeterFeatures)3 MeterKey (org.onosproject.net.meter.MeterKey)3 MeterStoreResult (org.onosproject.net.meter.MeterStoreResult)3 Test (org.junit.Test)2 MeterQuery (org.onosproject.net.behaviour.MeterQuery)2 DriverHandler (org.onosproject.net.driver.DriverHandler)2 DefaultMeter (org.onosproject.net.meter.DefaultMeter)2 Meter (org.onosproject.net.meter.Meter)2 MeterCellId (org.onosproject.net.meter.MeterCellId)2 Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)1 Collections2 (com.google.common.collect.Collections2)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Iterables (com.google.common.collect.Iterables)1 Lists (com.google.common.collect.Lists)1 Maps (com.google.common.collect.Maps)1 Collection (java.util.Collection)1