本文整理汇总了Java中org.onosproject.store.serializers.KryoNamespaces类的典型用法代码示例。如果您正苦于以下问题:Java KryoNamespaces类的具体用法?Java KryoNamespaces怎么用?Java KryoNamespaces使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KryoNamespaces类属于org.onosproject.store.serializers包,在下文中一共展示了KryoNamespaces类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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");
}
开发者ID:shlee89,项目名称:athena,代码行数:20,代码来源:UiTopoLayoutManager.java
示例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");
}
开发者ID:shlee89,项目名称:athena,代码行数:20,代码来源:UiExtensionManager.java
示例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");
}
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:Bmv2TableEntryServiceImpl.java
示例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");
}
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:DistributedTunnelStore.java
示例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");
}
开发者ID:shlee89,项目名称:athena,代码行数:20,代码来源:DistributedMcastStore.java
示例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");
}
开发者ID:shlee89,项目名称:athena,代码行数:23,代码来源:DistributedMeterStore.java
示例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();
}
开发者ID:shlee89,项目名称:athena,代码行数:17,代码来源:DistributedAlarmStore.java
示例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");
}
开发者ID:shlee89,项目名称:athena,代码行数:24,代码来源:DistributedDhcpStore.java
示例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");
}
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:TenantNetworkManager.java
示例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");
}
开发者ID:shlee89,项目名称:athena,代码行数:17,代码来源:RouterInterfaceManager.java
示例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");
}
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:FloatingIpManager.java
示例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");
}
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:SubnetManager.java
示例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");
}
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:PortChainManager.java
示例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");
}
开发者ID:shlee89,项目名称:athena,代码行数:19,代码来源:PortPairGroupManager.java
示例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");
}
开发者ID:shlee89,项目名称:athena,代码行数:20,代码来源:PortPairManager.java
示例16: 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(Router.class, RouterId.class, DefaultRouter.class,
TenantNetworkId.class, TenantId.class,
VirtualPortId.class, DefaultRouter.class,
RouterGateway.class, Router.Status.class,
SubnetId.class, FixedIp.class);
routerStore = storageService
.<RouterId, Router>eventuallyConsistentMapBuilder()
.withName(ROUTER).withSerializer(serializer)
.withTimestampProvider((k, v) -> new WallClockTimestamp())
.build();
routerStore.addListener(routerListener);
log.info("Started");
}
开发者ID:shlee89,项目名称:athena,代码行数:20,代码来源:RouterManager.java
示例17: McastHandler
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
/**
* Constructs the McastEventHandler.
*
* @param srManager Segment Routing manager
*/
public McastHandler(SegmentRoutingManager srManager) {
coreAppId = srManager.coreService.getAppId(CoreService.CORE_APP_NAME);
this.srManager = srManager;
this.storageService = srManager.storageService;
this.topologyService = srManager.topologyService;
mcastKryo = new KryoNamespace.Builder()
.register(KryoNamespaces.API)
.register(McastStoreKey.class)
.register(McastRole.class);
mcastNextObjStore = storageService
.<McastStoreKey, NextObjective>consistentMapBuilder()
.withName("onos-mcast-nextobj-store")
.withSerializer(Serializer.using(mcastKryo.build("McastHandler-NextObj")))
.build();
mcastRoleStore = storageService
.<McastStoreKey, McastRole>consistentMapBuilder()
.withName("onos-mcast-role-store")
.withSerializer(Serializer.using(mcastKryo.build("McastHandler-Role")))
.build();
}
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:McastHandler.java
示例18: createSerializer
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
private KryoNamespace.Builder createSerializer() {
return new KryoNamespace.Builder()
.register(KryoNamespaces.API)
.register(NeighborSetNextObjectiveStoreKey.class,
SubnetNextObjectiveStoreKey.class,
SubnetAssignedVidStoreKey.class,
NeighborSet.class,
Tunnel.class,
DefaultTunnel.class,
Policy.class,
TunnelPolicy.class,
Policy.Type.class,
PortNextObjectiveStoreKey.class,
XConnectStoreKey.class
);
}
开发者ID:shlee89,项目名称:athena,代码行数:17,代码来源:SegmentRoutingManager.java
示例19: createSerializer
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
private StoreSerializer createSerializer(KryoNamespace ns) {
return StoreSerializer.using(KryoNamespace.newBuilder()
.register(ns)
// not so robust way to avoid collision with other
// user supplied registrations
.nextId(KryoNamespaces.BEGIN_USER_CUSTOM_ID + 100)
.register(KryoNamespaces.BASIC)
.register(LogicalTimestamp.class)
.register(WallClockTimestamp.class)
.register(AntiEntropyAdvertisement.class)
.register(AntiEntropyResponse.class)
.register(UpdateEntry.class)
.register(MapValue.class)
.register(MapValue.Digest.class)
.register(UpdateRequest.class)
.build(name() + "-ecmap"));
}
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:EventuallyConsistentMapImpl.java
示例20: activate
import org.onosproject.store.serializers.KryoNamespaces; //导入依赖的package包/类
@Activate
public void activate() {
Map<PartitionId, DistributedPrimitiveCreator> partitionMap = Maps.newHashMap();
partitionService.getAllPartitionIds().stream()
.filter(id -> !id.equals(PartitionId.from(0)))
.forEach(id -> partitionMap.put(id, partitionService.getDistributedPrimitiveCreator(id)));
federatedPrimitiveCreator = new FederatedDistributedPrimitiveCreator(partitionMap);
transactions = this.<TransactionId, Transaction.State>consistentMapBuilder()
.withName("onos-transactions")
.withSerializer(Serializer.using(KryoNamespaces.API,
Transaction.class,
Transaction.State.class))
.buildAsyncMap();
transactionCoordinator = new TransactionCoordinator(transactions);
log.info("Started");
}
开发者ID:shlee89,项目名称:athena,代码行数:17,代码来源:StorageManager.java
注:本文中的org.onosproject.store.serializers.KryoNamespaces类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论