当前位置: 首页>>代码示例>>Java>>正文


Java ConcurrentInvertedRadixTree类代码示例

本文整理汇总了Java中com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree的典型用法代码示例。如果您正苦于以下问题:Java ConcurrentInvertedRadixTree类的具体用法?Java ConcurrentInvertedRadixTree怎么用?Java ConcurrentInvertedRadixTree使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ConcurrentInvertedRadixTree类属于com.googlecode.concurrenttrees.radixinverted包,在下文中一共展示了ConcurrentInvertedRadixTree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: activate

import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree; //导入依赖的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());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:17,代码来源:DefaultRouter.java

示例2: stop

import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree; //导入依赖的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();
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:DefaultRouter.java

示例3: stop

import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree; //导入依赖的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();
	}
}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:18,代码来源:RibManager.java

示例4: stop

import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree; //导入依赖的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();
    }
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:21,代码来源:Router.java

示例5: main

import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree; //导入依赖的package包/类
public static void main(String[] args) {
    InvertedRadixTree<Integer> tree = new ConcurrentInvertedRadixTree<Integer>(new DefaultCharArrayNodeFactory());

    tree.put("TEST", 1);
    tree.put("TOAST", 2);
    tree.put("TEAM", 3);

    System.out.println("Tree structure:");
    // PrettyPrintable is a non-public API for testing, prints semi-graphical representations of trees...
    PrettyPrinter.prettyPrint((PrettyPrintable) tree, System.out);

    System.out.println();
    System.out.println("Value for 'TEST' (exact match): " + tree.getValueForExactKey("TEST"));
    System.out.println("Value for 'TOAST' (exact match): " + tree.getValueForExactKey("TOAST"));
    System.out.println();
    System.out.println("Keys contained in 'MY TEAM LIKES TOAST': " + Iterables.toString(tree.getKeysContainedIn("MY TEAM LIKES TOAST")));
    System.out.println("Keys contained in 'MY TEAM LIKES TOASTERS': " + Iterables.toString(tree.getKeysContainedIn("MY TEAM LIKES TOASTERS")));
    System.out.println("Values for keys contained in 'MY TEAM LIKES TOAST': " + Iterables.toString(tree.getValuesForKeysContainedIn("MY TEAM LIKES TOAST")));
    System.out.println("Key-value pairs for keys contained in 'MY TEAM LIKES TOAST': " + Iterables.toString(tree.getKeyValuePairsForKeysContainedIn("MY TEAM LIKES TOAST")));
}
 
开发者ID:npgall,项目名称:concurrent-trees,代码行数:21,代码来源:InvertedRadixTreeUsage.java

示例6: QuikDomains

import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree; //导入依赖的package包/类
public QuikDomains() {
	// Initialize
	this.domains = new HashSet<>();
	this.domainTree = new ConcurrentInvertedRadixTree<>(new DefaultCharArrayNodeFactory());
	
	// Manually add QuikCore
	this.domains.add("quikcore");
	this.domainTree.put("com.github.quikmod.quikcore", "quikcore");
}
 
开发者ID:QuikMod,项目名称:QuikCore,代码行数:10,代码来源:QuikDomains.java

示例7: onSessionInitiated

import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree; //导入依赖的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());
}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:9,代码来源:RibManager.java

示例8: activate

import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree; //导入依赖的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());
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:15,代码来源:Router.java

示例9: InvertedRadixTreeIndex

import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree; //导入依赖的package包/类
/**
 * Package-private constructor, used by static factory methods.
 */
protected InvertedRadixTreeIndex(Attribute<O, A> attribute, NodeFactory nodeFactory) {
    super(attribute, new HashSet<Class<? extends Query>>() {{
        add(Equal.class);
        add(In.class);
        add(StringIsContainedIn.class);
    }});
    this.nodeFactory = nodeFactory;
    this.tree = new ConcurrentInvertedRadixTree<StoredResultSet<O>>(nodeFactory);
}
 
开发者ID:npgall,项目名称:cqengine,代码行数:13,代码来源:InvertedRadixTreeIndex.java

示例10: RulesBySsurt

import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree; //导入依赖的package包/类
RulesBySsurt(Collection<AccessRule> rules) {
    tree = new ConcurrentInvertedRadixTree<>(new DefaultCharArrayNodeFactory());
    for (AccessRule rule: rules) {
        try {
            put(rule);
        } catch (IllegalArgumentException e) {
            log.log(Level.WARNING, "Skipping invalid access rule: " + rule.id, e);
        }
    }
}
 
开发者ID:nla,项目名称:outbackcdx,代码行数:11,代码来源:AccessControl.java

示例11: setDrawerItems

import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree; //导入依赖的package包/类
public synchronized void setDrawerItems(ArrayList<DrawerItem> drawerItems) {
    tree = new ConcurrentInvertedRadixTree<>(new DefaultCharArrayNodeFactory());
    for (int i = 0; i < drawerItems.size(); i++) {
        String path = drawerItems.get(i).path;
        if(path != null) tree.put(path, i);
    }
    this.drawerItems = drawerItems;
}
 
开发者ID:TeamAmaze,项目名称:AmazeFileManager,代码行数:9,代码来源:DataUtils.java

示例12: init

import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree; //导入依赖的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);
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:15,代码来源:SdnIpConfigReader.java

示例13: getOutgoingInterfaceTest

import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree; //导入依赖的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());
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:44,代码来源:RadixTreeTest.java

示例14: RouteTable

import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree; //导入依赖的package包/类
/**
 * Creates a new route table.
 */
public RouteTable() {
    routeTable = new ConcurrentInvertedRadixTree<>(
            new DefaultByteArrayNodeFactory());

    alternativeRoutes = Maps.newHashMap();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:10,代码来源:DefaultResolvedRouteStore.java

示例15: RouteTable

import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree; //导入依赖的package包/类
/**
 * Creates a new route table.
 */
public RouteTable() {
    routeTable = new ConcurrentInvertedRadixTree<>(
            new DefaultByteArrayNodeFactory());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:8,代码来源:LocalRouteStore.java


注:本文中的com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。