Skip to content

Commit

Permalink
Merge pull request #1 from xieus/fix/subnet_concurrent_delete_issue
Browse files Browse the repository at this point in the history
Fix/subnet concurrent delete issue
  • Loading branch information
pkommoju authored Aug 27, 2021
2 parents 70e9251 + 06bc414 commit a36b1c5
Show file tree
Hide file tree
Showing 20 changed files with 313 additions and 286 deletions.
196 changes: 98 additions & 98 deletions kubernetes/services/ignite_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,104 +45,104 @@ Copyright(c) 2020 Futurewei Cloud

<property name="cacheConfiguration">
<list>
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.web.entity.vpc.VpcEntity"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="dpm_nodeinfo_cache"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.dataplane.entity.InternalPorts"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.dataplane.entity.InternalSubnets"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.dataplane.entity.InternalSubnetPorts"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.dataplane.entity.GatewayInfo"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="ncm_nodeinfo_cache"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.netwconfigmanager.entity.ResourceMeta"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.netwconfigmanager.entity.VpcResourceMeta"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="java.lang.Object"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.dataplane.entity.VpcResourceMeta"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.web.entity.vpc.VpcEntity"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="dpm_nodeinfo_cache"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.dataplane.entity.InternalPorts"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.dataplane.entity.InternalSubnets"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.dataplane.entity.InternalSubnetPorts"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.dataplane.entity.GatewayInfo"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="ncm_nodeinfo_cache"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.netwconfigmanager.entity.ResourceMeta"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.netwconfigmanager.entity.VpcResourceMeta"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="java.lang.Object"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.dataplane.entity.VpcResourceMeta"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>
</list>
</property>

Expand Down
33 changes: 33 additions & 0 deletions kubernetes/services/ignite_ip_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,42 @@ Copyright(c) 2020 Futurewei Cloud
</bean>
</property>
<property name="storagePath" value="/opt/ip"/>
<property name="walPath" value="/db/wal"/>
<property name="walArchivePath" value="/db/wal/archive"/>
</bean>
</property>

<property name="cacheConfiguration">
<list>
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.privateipmanager.entity.IpAddrAlloc"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.privateipmanager.entity.IpAddrRange"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="com.futurewei.alcor.privateipmanager.entity.VpcIpRange"/>
<!-- Set the cache mode. -->
<property name="atomicityMode" value="TRANSACTIONAL"/>
<!-- Other cache parameters. -->
<property name="cacheMode" value="PARTITIONED"/>
</bean>
</list>
</property>

<!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public interface ICacheFactory {

<K, V> ICache<K, V> getCache(Class<V> v, CacheConfiguration cacheConfig);

/**
* get a cache with cache name and configuration
* @return
*/
<K, V> ICache<K, V> getCache(Class<V> v, CacheConfiguration cacheConfig);

/**
* get a cache with auto set expire time
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ free of charge, to any person obtaining a copy of this software and associated d
import javax.cache.expiry.Duration;
import javax.cache.expiry.ExpiryPolicy;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;

public class IgniteCacheFactory implements ICacheFactory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ free of charge, to any person obtaining a copy of this software and associated d
import com.futurewei.alcor.common.db.Transaction;
import org.apache.ignite.client.IgniteClient;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.ClientConfiguration;

import javax.cache.expiry.CreatedExpiryPolicy;
import javax.cache.expiry.Duration;
import javax.cache.expiry.ExpiryPolicy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ free of charge, to any person obtaining a copy of this software and associated d
package com.futurewei.alcor.common.db.ignite;

import com.futurewei.alcor.common.db.ICacheFactory;
import com.futurewei.alcor.common.db.IDistributedLockFactory;
import com.futurewei.alcor.common.logging.Logger;
import com.futurewei.alcor.common.logging.LoggerFactory;
import org.apache.ignite.Ignite;
Expand Down Expand Up @@ -81,8 +80,8 @@ public class IgniteConfiguration {

@Bean
@Primary
public ICacheFactory igniteClientFactoryInstance(){
if(thinClientEnable){
public ICacheFactory igniteClientFactoryInstance() {
if (thinClientEnable) {

return new IgniteClientCacheFactory(this.getThinIgniteClient(),
this.tryLockInterval, this.expireTime);
Expand Down Expand Up @@ -145,10 +144,10 @@ private Ignite getIgniteClient(String instanceName) {
SslContextFactory factory = new SslContextFactory();
factory.setKeyStoreFilePath(keyStorePath);
factory.setKeyStorePassword(keyStorePassword.toCharArray());
if(trustStorePath != null && trustStorePassword != null) {
if (trustStorePath != null && trustStorePassword != null) {
factory.setTrustStoreFilePath(trustStorePath);
factory.setTrustStorePassword(trustStorePassword.toCharArray());
}else{
} else {
factory.setTrustManagers(SslContextFactory.getDisabledTrustManager());
}

Expand Down
Loading

0 comments on commit a36b1c5

Please sign in to comment.