本文整理汇总了Java中org.onosproject.store.primitives.DefaultDistributedSet类的典型用法代码示例。如果您正苦于以下问题:Java DefaultDistributedSet类的具体用法?Java DefaultDistributedSet怎么用?Java DefaultDistributedSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultDistributedSet类属于org.onosproject.store.primitives包,在下文中一共展示了DefaultDistributedSet类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: activate
import org.onosproject.store.primitives.DefaultDistributedSet; //导入依赖的package包/类
@Activate
public void activate() {
local = clusterService.getLocalNode().id();
meters = storageService.<MeterKey, MeterData>consistentMapBuilder()
.withName(METERSTORE)
.withSerializer(serializer).build();
meters.addListener(mapListener);
meterFeatures = storageService.<MeterFeaturesKey, MeterFeatures>consistentMapBuilder()
.withName(METERFEATURESSTORE)
.withSerializer(Serializer.using(KryoNamespaces.API,
MeterFeaturesKey.class,
MeterFeatures.class,
DefaultMeterFeatures.class,
Band.Type.class,
Meter.Unit.class,
MeterFailReason.class,
MeterFeaturesFlag.class)).build();
// Init the set of the available ids
availableMeterIds = new DefaultDistributedSet<>(storageService.<MeterKey>setBuilder()
.withName(AVAILABLEMETERIDSTORE)
.withSerializer(Serializer.using(KryoNamespaces.API,
MeterKey.class)).build(),
DistributedPrimitive.DEFAULT_OPERATION_TIMEOUT_MILLIS);
// Init atomic map counters
meterIdGenerators = storageService.<DeviceId>atomicCounterMapBuilder()
.withName(METERIDSTORE)
.withSerializer(Serializer.using(KryoNamespaces.API)).build();
log.info("Started");
}
示例2: asDistributedSet
import org.onosproject.store.primitives.DefaultDistributedSet; //导入依赖的package包/类
@Override
public DistributedSet<E> asDistributedSet() {
return new DefaultDistributedSet<>(this, 0);
}
示例3: asDistributedSet
import org.onosproject.store.primitives.DefaultDistributedSet; //导入依赖的package包/类
/**
* Returns a new {@link DistributedSet} that is backed by this instance.
*
* @param timeoutMillis timeout duration for the returned DistributedSet operations
* @return new {@code DistributedSet} instance
*/
default DistributedSet<E> asDistributedSet(long timeoutMillis) {
return new DefaultDistributedSet<>(this, timeoutMillis);
}