本文整理汇总了Java中org.onosproject.store.serializers.KryoNamespaces类的典型用法代码示例。如果您正苦于以下问题:Java KryoNamespaces类的具体用法?Java KryoNamespaces怎么用?Java KryoNamespaces使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KryoNamespaces类属于org.onosproject.store.serializers包,在下文中一共展示了KryoNamespaces类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: activate
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
@Activate
public void activate() {
KryoNamespace.Builder kryoBuilder = new KryoNamespace.Builder()
.register(KryoNamespaces.API)
.register(UiTopoLayoutId.class)
.register(UiTopoLayout.class);
layouts = storageService.<UiTopoLayoutId, UiTopoLayout>consistentMapBuilder()
.withSerializer(Serializer.using(kryoBuilder.build()))
.withName("onos-topo-layouts")
.withRelaxedReadConsistency()
.build();
layoutMap = layouts.asJavaMap();
// Create and add the default layout, if needed.
layoutMap.computeIfAbsent(DEFAULT_ID, k -> new UiTopoLayout(k, null, null));
log.info("Started");
}
示例2: activate
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
@Activate
public void activate() {
Serializer serializer = Serializer.using(KryoNamespaces.API,
ObjectNode.class, ArrayNode.class,
JsonNodeFactory.class, LinkedHashMap.class,
TextNode.class, BooleanNode.class,
LongNode.class, DoubleNode.class, ShortNode.class,
IntNode.class, NullNode.class);
prefsConsistentMap = storageService.<String, ObjectNode>consistentMapBuilder()
.withName(ONOS_USER_PREFERENCES)
.withSerializer(serializer)
.withRelaxedReadConsistency()
.build();
prefsConsistentMap.addListener(prefsListener);
prefs = prefsConsistentMap.asJavaMap();
register(core);
log.info("Started");
}
示例3: activate
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
@Activate
public void activate() {
KryoNamespace kryo = new KryoNamespace.Builder()
.register(KryoNamespaces.API)
.register(Bmv2TableEntryReference.class)
.register(Bmv2MatchKey.class)
.register(Bmv2ExactMatchParam.class)
.register(Bmv2TernaryMatchParam.class)
.register(Bmv2LpmMatchParam.class)
.register(Bmv2ValidMatchParam.class)
.register(Bmv2FlowRuleWrapper.class)
.build();
flowRules = storageService.<Bmv2TableEntryReference, Bmv2FlowRuleWrapper>eventuallyConsistentMapBuilder()
.withSerializer(kryo)
.withTimestampProvider((k, v) -> new WallClockTimestamp())
.withName("onos-bmv2-flowrules")
.build();
log.info("Started");
}
示例4: activate
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
@Activate
public void activate() {
KryoNamespace.Builder serializer = KryoNamespace.newBuilder()
.register(KryoNamespaces.API)
.register(MultiValuedTimestamp.class);
tunnelIdAsKeyStore = storageService
.<TunnelId, Tunnel>eventuallyConsistentMapBuilder()
.withName("all_tunnel").withSerializer(serializer)
.withTimestampProvider((k, v) -> new WallClockTimestamp()).build();
orderRelationship = storageService
.<ApplicationId, Set<TunnelSubscription>>eventuallyConsistentMapBuilder()
.withName("type_tunnel").withSerializer(serializer)
.withTimestampProvider((k, v) -> new WallClockTimestamp()).build();
idGenerator = coreService.getIdGenerator(tunnelOpTopic);
tunnelIdAsKeyStore.addListener(tunnelUpdateListener);
log.info("Started");
}
示例5: activate
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
@Activate
public void activate() {
mcastRib = storageService.<McastRoute, MulticastData>consistentMapBuilder()
.withName(MCASTRIB)
.withSerializer(Serializer.using(KryoNamespace.newBuilder()
.register(KryoNamespaces.API)
.register(
AtomicReference.class,
MulticastData.class,
McastRoute.class,
McastRoute.Type.class
).build()))
//.withRelaxedReadConsistency()
.build();
mcastRib.addListener(mcastMapListener);
mcastRoutes = mcastRib.asJavaMap();
log.info("Started");
}
示例6: activate
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
@Activate
public void activate() {
local = clusterService.getLocalNode().id();
meters = storageService.<MeterKey, MeterData>consistentMapBuilder()
.withName(METERSTORE)
.withSerializer(Serializer.using(Arrays.asList(KryoNamespaces.API),
MeterKey.class,
MeterData.class,
DefaultMeter.class,
DefaultBand.class,
Band.Type.class,
MeterState.class,
Meter.Unit.class,
MeterFailReason.class)).build();
meters.addListener(mapListener);
log.info("Started");
}
示例7: activate
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
@Activate
public void activate() {
log.info("Started");
alarms = storageService.<AlarmId, Alarm>consistentMapBuilder()
.withName("onos-alarm-table")
.withSerializer(Serializer.using(KryoNamespaces.API,
Alarm.class,
DefaultAlarm.class,
AlarmId.class,
AlarmEvent.Type.class,
Alarm.SeverityLevel.class,
AlarmEntityId.class))
.build();
alarms.addListener(listener);
alarmsMap = alarms.asJavaMap();
}
示例8: activate
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
@Activate
protected void activate() {
allocationMap = storageService.<HostId, IpAssignment>consistentMapBuilder()
.withName("onos-dhcp-assignedIP")
.withSerializer(Serializer.using(
new KryoNamespace.Builder()
.register(KryoNamespaces.API)
.register(IpAssignment.class,
IpAssignment.AssignmentStatus.class,
Date.class,
long.class,
Ip4Address.class)
.build()))
.build();
freeIPPool = storageService.<Ip4Address>setBuilder()
.withName("onos-dhcp-freeIP")
.withSerializer(Serializer.using(KryoNamespaces.API))
.build()
.asDistributedSet();
log.info("Started");
}
示例9: activate
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
@Activate
public void activate() {
appId = coreService.registerApplication(VTNRSC_APP);
networkIdAsKeyStore = storageService.<TenantNetworkId, TenantNetwork>consistentMapBuilder()
.withName(TENANTNETWORK)
.withApplicationId(appId)
.withPurgeOnUninstall()
.withSerializer(Serializer.using(Arrays.asList(KryoNamespaces.API),
TenantNetworkId.class,
DefaultTenantNetwork.class,
TenantNetwork.State.class,
TenantId.class,
TenantNetwork.Type.class,
PhysicalNetwork.class,
SegmentationId.class))
.build().asJavaMap();
log.info("Started");
}
示例10: activate
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
@Activate
public void activate() {
appId = coreService.registerApplication(VTNRSC_APP);
KryoNamespace.Builder serializer = KryoNamespace
.newBuilder()
.register(KryoNamespaces.API)
.register(RouterId.class, TenantId.class, VirtualPortId.class,
RouterInterface.class, SubnetId.class);
routerInterfaceStore = storageService
.<SubnetId, RouterInterface>eventuallyConsistentMapBuilder()
.withName(ROUTER_INTERFACE).withSerializer(serializer)
.withTimestampProvider((k, v) -> new WallClockTimestamp())
.build();
routerInterfaceStore.addListener(routerInterfaceListener);
log.info("Started");
}
示例11: activate
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
@Activate
public void activate() {
appId = coreService.registerApplication(VTNRSC_APP);
KryoNamespace.Builder serializer = KryoNamespace
.newBuilder()
.register(KryoNamespaces.API)
.register(FloatingIp.class, FloatingIpId.class,
TenantNetworkId.class, TenantId.class,
FloatingIp.Status.class, RouterId.class,
VirtualPortId.class, DefaultFloatingIp.class,
UUID.class);
floatingIpStore = storageService
.<FloatingIpId, FloatingIp>eventuallyConsistentMapBuilder()
.withName(FLOATINGIPSTORE).withSerializer(serializer)
.withTimestampProvider((k, v) -> new WallClockTimestamp())
.build();
floatingIpBindStore = storageService
.<FloatingIpId, FloatingIp>eventuallyConsistentMapBuilder()
.withName(FLOATINGIPBINDSTORE).withSerializer(serializer)
.withTimestampProvider((k, v) -> new WallClockTimestamp())
.build();
floatingIpStore.addListener(floatingIpListener);
log.info("Started");
}
示例12: activate
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
@Activate
public void activate() {
appId = coreService.registerApplication(VTNRSC_APP);
subnetStore = storageService.<SubnetId, Subnet>consistentMapBuilder()
.withName(SUBNET)
.withApplicationId(appId)
.withPurgeOnUninstall()
.withSerializer(Serializer.using(Arrays.asList(KryoNamespaces.API),
Subnet.class,
SubnetId.class,
TenantNetworkId.class,
TenantId.class,
HostRoute.class,
DefaultHostRoute.class,
Subnet.Mode.class,
AllocationPool.class,
DefaultAllocationPool.class,
DefaultSubnet.class,
IpAddress.Version.class))
.build().asJavaMap();
log.info("Started");
}
示例13: activate
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
@Activate
public void activate() {
eventDispatcher.addSink(PortChainEvent.class, listenerRegistry);
KryoNamespace.Builder serializer = KryoNamespace.newBuilder()
.register(KryoNamespaces.API)
.register(MultiValuedTimestamp.class)
.register(PortChain.class, PortChainId.class, UUID.class, PortPairGroupId.class,
FlowClassifierId.class, FiveTuple.class, LoadBalanceId.class, DeviceId.class,
DefaultPortChain.class, PortPairId.class, TenantId.class);
portChainStore = storageService
.<PortChainId, PortChain>eventuallyConsistentMapBuilder()
.withName("portchainstore").withSerializer(serializer)
.withTimestampProvider((k, v) -> new WallClockTimestamp()).build();
portChainStore.addListener(portChainListener);
log.info("Started");
}
示例14: activate
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
@Activate
public void activate() {
eventDispatcher.addSink(PortPairGroupEvent.class, listenerRegistry);
KryoNamespace.Builder serializer = KryoNamespace.newBuilder()
.register(KryoNamespaces.API)
.register(MultiValuedTimestamp.class)
.register(PortPairGroup.class, PortPairGroupId.class, UUID.class, DefaultPortPairGroup.class,
TenantId.class, PortPairId.class);
portPairGroupStore = storageService
.<PortPairGroupId, PortPairGroup>eventuallyConsistentMapBuilder()
.withName("portpairgroupstore").withSerializer(serializer)
.withTimestampProvider((k, v) -> new WallClockTimestamp()).build();
portPairGroupStore.addListener(portPairGroupListener);
log.info("Started");
}
示例15: activate
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
@Activate
public void activate() {
eventDispatcher.addSink(PortPairEvent.class, listenerRegistry);
KryoNamespace.Builder serializer = KryoNamespace.newBuilder()
.register(KryoNamespaces.API)
.register(MultiValuedTimestamp.class)
.register(PortPair.class, PortPairId.class, UUID.class, DefaultPortPair.class, TenantId.class);
portPairStore = storageService.<PortPairId, PortPair>eventuallyConsistentMapBuilder()
.withName("portpairstore")
.withSerializer(serializer)
.withTimestampProvider((k, v) -> new WallClockTimestamp())
.build();
portPairStore.addListener(portPairListener);
log.info("Started");
}