本文整理汇总了Java中com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory类的典型用法代码示例。如果您正苦于以下问题:Java DefaultByteArrayNodeFactory类的具体用法?Java DefaultByteArrayNodeFactory怎么用?Java DefaultByteArrayNodeFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultByteArrayNodeFactory类属于com.googlecode.concurrenttrees.radix.node.concrete包,在下文中一共展示了DefaultByteArrayNodeFactory类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: activate
import com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory; //导入依赖的package包/类
@Activate
public void activate() {
ribTable4 = new ConcurrentInvertedRadixTree<>(
new DefaultByteArrayNodeFactory());
ribTable6 = new ConcurrentInvertedRadixTree<>(
new DefaultByteArrayNodeFactory());
routesWaitingOnArp = Multimaps.synchronizedSetMultimap(
HashMultimap.create());
coreService.registerApplication(ROUTER_APP_ID);
bgpUpdatesExecutor = Executors.newSingleThreadExecutor(
new ThreadFactoryBuilder()
.setNameFormat("rib-updates-%d").build());
}
示例2: stop
import com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory; //导入依赖的package包/类
@Override
public void stop() {
routeSourceService.stop();
this.hostService.removeListener(hostListener);
// Stop the thread(s)
bgpUpdatesExecutor.shutdownNow();
synchronized (this) {
// Cleanup all local state
ribTable4 = new ConcurrentInvertedRadixTree<>(
new DefaultByteArrayNodeFactory());
ribTable6 = new ConcurrentInvertedRadixTree<>(
new DefaultByteArrayNodeFactory());
routeUpdatesQueue.clear();
routesWaitingOnArp.clear();
ip2Mac.clear();
}
}
示例3: stop
import com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory; //导入依赖的package包/类
@Override
public void stop() {
// TODO Auto-generated method stub
this.closed = true;
// Stop host service
hostService.stop();
// Stop the thread(s)
bgpUpdatesExecutor.shutdownNow();
synchronized (this) {
// Cleanup all local state
ribTable4 = new ConcurrentInvertedRadixTree<>(new DefaultByteArrayNodeFactory());
routeUpdatesQueue.clear();
routesWaitingOnArp.clear();
ip2Mac.clear();
}
}
示例4: stop
import com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory; //导入依赖的package包/类
@Override
public void stop() {
bgpService.stop();
this.hostService.removeListener(hostListener);
// Stop the thread(s)
bgpUpdatesExecutor.shutdownNow();
synchronized (this) {
// Cleanup all local state
ribTable4 = new ConcurrentInvertedRadixTree<>(
new DefaultByteArrayNodeFactory());
ribTable6 = new ConcurrentInvertedRadixTree<>(
new DefaultByteArrayNodeFactory());
routeUpdatesQueue.clear();
routesWaitingOnArp.clear();
ip2Mac.clear();
}
}
示例5: onSessionInitiated
import com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory; //导入依赖的package包/类
@Override
public void onSessionInitiated(ProviderContext session) {
LOG.info("Router Session Initiated");
routesWaitingOnArp = Multimaps.synchronizedSetMultimap(HashMultimap.<AtriumIpAddress, RouteEntry> create());
ribTable4 = new ConcurrentInvertedRadixTree<>(new DefaultByteArrayNodeFactory());
bgpUpdatesExecutor = Executors
.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("atrium-bgp-updates-%d").build());
}
示例6: activate
import com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory; //导入依赖的package包/类
@Activate
public void activate() {
ribTable4 = new ConcurrentInvertedRadixTree<>(
new DefaultByteArrayNodeFactory());
ribTable6 = new ConcurrentInvertedRadixTree<>(
new DefaultByteArrayNodeFactory());
routesWaitingOnArp = Multimaps.synchronizedSetMultimap(
HashMultimap.<IpAddress, RouteEntry>create());
bgpUpdatesExecutor = Executors.newSingleThreadExecutor(
new ThreadFactoryBuilder()
.setNameFormat("sdnip-bgp-updates-%d").build());
}
示例7: init
import com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context) throws FloodlightModuleException {
interfaceRoutes = new ConcurrentInvertedRadixTree<>(
new DefaultByteArrayNodeFactory());
externalNetworkSwitchPorts = new HashSet<SwitchPort>();
// Reading config values
String configFilenameParameter = context.getConfigParams(this).get("configfile");
if (configFilenameParameter != null) {
currentConfigFilename = configFilenameParameter;
}
log.debug("Config file set to {}", currentConfigFilename);
readConfiguration(currentConfigFilename);
}
示例8: getOutgoingInterfaceTest
import com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory; //导入依赖的package包/类
/**
* This is just a test of the InvertedRadixTree, rather than an actual unit
* test of SdnIp. It tests that the algorithm used to retrieve the
* longest prefix match from the tree actually does retrieve the longest
* prefix, and not just any matching prefix.
*/
@Test
public void getOutgoingInterfaceTest() {
interfaces = new HashMap<>();
interfaceRoutes = new ConcurrentInvertedRadixTree<>(
new DefaultByteArrayNodeFactory());
Interface interface1 = new Interface("sw3-eth1", "00:00:00:00:00:00:00:a3",
(short) 1, "192.168.10.101", 24);
interfaces.put(interface1.getName(), interface1);
Interface interface2 = new Interface("sw5-eth1", "00:00:00:00:00:00:00:a5",
(short) 1, "192.168.20.101", 16);
interfaces.put(interface2.getName(), interface2);
Interface interface3 = new Interface("sw2-eth1", "00:00:00:00:00:00:00:a2",
(short) 1, "192.168.60.101", 16);
interfaces.put(interface3.getName(), interface3);
Interface interface4 = new Interface("sw6-eth1", "00:00:00:00:00:00:00:a6",
(short) 1, "192.168.60.101", 30);
interfaces.put(interface4.getName(), interface4);
Interface interface5 = new Interface("sw4-eth4", "00:00:00:00:00:00:00:a4",
(short) 4, "192.168.60.101", 24);
interfaces.put(interface5.getName(), interface5);
for (Interface intf : interfaces.values()) {
Prefix prefix = new Prefix(intf.getIpAddress().getAddress(),
intf.getPrefixLength());
interfaceRoutes.put(prefix.toBinaryString(), intf);
}
// Check whether the prefix length takes effect
InetAddress nextHopAddress = InetAddresses.forString("192.0.0.1");
assertNotNull(nextHopAddress);
assertNull(longestInterfacePrefixMatch(nextHopAddress));
// Check whether it returns the longest matchable address
nextHopAddress = InetAddresses.forString("192.168.60.101");
assertEquals("sw6-eth1", longestInterfacePrefixMatch(nextHopAddress).getName());
}
示例9: RouteTable
import com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory; //导入依赖的package包/类
/**
* Creates a new route table.
*/
public RouteTable() {
routeTable = new ConcurrentInvertedRadixTree<>(
new DefaultByteArrayNodeFactory());
alternativeRoutes = Maps.newHashMap();
}
示例10: clear
import com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory; //导入依赖的package包/类
/**
* Clear history
*/
public void clear() {
_map.clear();
_tree = new ConcurrentRadixTree<>(new DefaultByteArrayNodeFactory());
}
示例11: RouteTable
import com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory; //导入依赖的package包/类
/**
* Creates a new route table.
*/
public RouteTable() {
routeTable = new ConcurrentInvertedRadixTree<>(
new DefaultByteArrayNodeFactory());
}
示例12: getType
import com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory; //导入依赖的package包/类
/**
* For a given type name, look through the type system and return the matching class.
* If two types of the same name (but different packages) exist, then null will be returned and the package will need to be included in the typeName.
*
* @param typeName The name of the type, optionally including the package
* @param typeSystem The type system to search
* @return The class associated with that type
*/
@SuppressWarnings("unchecked")
public static Class<AnnotationBase> getType(String typeName, TypeSystem typeSystem){
SuffixTree<Class<AnnotationBase>> types = new ConcurrentSuffixTree<>(new DefaultByteArrayNodeFactory());
Iterator<Type> itTypes = typeSystem.getTypeIterator();
while(itTypes.hasNext()){
Type t = itTypes.next();
Class<AnnotationBase> c;
try {
String clazz = t.getName();
if(clazz.startsWith("uima.")){
continue;
} else if(clazz.endsWith("[]")){
clazz = clazz.substring(0, clazz.length() - 2);
}
Class<?> unchecked = Class.forName(clazz);
if(AnnotationBase.class.isAssignableFrom(unchecked)){
c = (Class<AnnotationBase>) unchecked;
types.put(t.getName(), c);
}else{
LOGGER.debug("Skipping class {} that doesn't inherit from AnnotationBase");
}
} catch (ClassNotFoundException e) {
LOGGER.warn("Unable to load class {} from type system", t.getName(), e);
}
}
Class<AnnotationBase> ret = getClassFromType("."+typeName, types);
if(ret == null){
ret = getClassFromType(typeName, types);
}
if(ret == null){
LOGGER.warn("No uniquely matching class found for type {}", typeName);
}
return ret;
}
示例13: init
import com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
throws FloodlightModuleException {
bgpRoutes = new ConcurrentInvertedRadixTree<>(
new DefaultByteArrayNodeFactory());
interfaceRoutes = new ConcurrentInvertedRadixTree<>(
new DefaultByteArrayNodeFactory());
externalNetworkSwitchPorts = new HashSet<SwitchPort>();
ribUpdates = new LinkedBlockingQueue<>();
// Register REST handler.
restApi = context.getServiceImpl(IRestApiService.class);
proxyArp = context.getServiceImpl(IProxyArpService.class);
controllerRegistryService = context
.getServiceImpl(IControllerRegistryService.class);
pathRuntime = context.getServiceImpl(IPathCalcRuntimeService.class);
linkDiscoveryService = context.getServiceImpl(ILinkDiscoveryService.class);
intentIdGenerator = new IdBlockAllocatorBasedIntentIdGenerator(
controllerRegistryService);
// TODO: initialize intentService
pushedRouteIntents = new ConcurrentHashMap<>();
prefixesWaitingOnArp = Multimaps.synchronizedSetMultimap(
HashMultimap.<InetAddress, RibUpdate>create());
//flowCache = new FlowCache(floodlightProvider);
bgpUpdatesExecutor = Executors.newSingleThreadExecutor(
new ThreadFactoryBuilder().setNameFormat("bgp-updates-%d").build());
// Read in config values
bgpdRestIp = context.getConfigParams(this).get("BgpdRestIp");
if (bgpdRestIp == null) {
log.error("BgpdRestIp property not found in config file");
throw new ConfigurationRuntimeException(
"BgpdRestIp property not found in config file");
} else {
log.info("BgpdRestIp set to {}", bgpdRestIp);
}
routerId = context.getConfigParams(this).get("RouterId");
if (routerId == null) {
log.error("RouterId property not found in config file");
throw new ConfigurationRuntimeException(
"RouterId property not found in config file");
} else {
log.info("RouterId set to {}", routerId);
}
String configFilenameParameter = context.getConfigParams(this).get("configfile");
if (configFilenameParameter != null) {
currentConfigFilename = configFilenameParameter;
}
log.debug("Config file set to {}", currentConfigFilename);
readConfiguration(currentConfigFilename);
}
示例14: RouteTable
import com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory; //导入依赖的package包/类
/**
* Creates a new route table.
*/
public RouteTable(RouteTableId id) {
this.id = checkNotNull(id);
routeTable = new ConcurrentInvertedRadixTree<>(
new DefaultByteArrayNodeFactory());
}