kandi background
Explore Kits

ignite | Apache Ignite is a distributed database | Database library

 by   apache Java Version: Current License: Apache-2.0

 by   apache Java Version: Current License: Apache-2.0

Download this library from

kandi X-RAY | ignite Summary

ignite is a Java library typically used in Database, Hadoop applications. ignite has build file available, it has a Permissive License and it has high support. However ignite has 3096 bugs and it has 185 vulnerabilities. You can install using 'pip install ignite' or download it from GitHub, PyPI.
Apache Ignite is a distributed database for high-performance computing with in-memory speed.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • ignite has a highly active ecosystem.
  • It has 4120 star(s) with 1765 fork(s). There are 279 watchers for this library.
  • It had no major release in the last 12 months.
  • ignite has no issues reported. There are 635 open pull requests and 0 closed requests.
  • It has a positive sentiment in the developer community.
  • The latest version of ignite is current.
ignite Support
Best in #Database
Average in #Database
ignite Support
Best in #Database
Average in #Database

quality kandi Quality

  • ignite has 3096 bugs (304 blocker, 221 critical, 1247 major, 1324 minor) and 42910 code smells.
ignite Quality
Best in #Database
Average in #Database
ignite Quality
Best in #Database
Average in #Database

securitySecurity

  • ignite has 2 vulnerability issues reported (1 critical, 0 high, 0 medium, 1 low).
  • ignite code analysis shows 183 unresolved vulnerabilities (162 blocker, 17 critical, 3 major, 1 minor).
  • There are 2130 security hotspots that need review.
ignite Security
Best in #Database
Average in #Database
ignite Security
Best in #Database
Average in #Database

license License

  • ignite is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
ignite License
Best in #Database
Average in #Database
ignite License
Best in #Database
Average in #Database

buildReuse

  • ignite releases are not available. You will need to build from source code and install.
  • Deployable package is available in PyPI.
  • Build file is available. You can build the component from source.
  • ignite saves you 3273936 person hours of effort in developing the same functionality from scratch.
  • It has 1242737 lines of code, 105775 functions and 13027 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
ignite Reuse
Best in #Database
Average in #Database
ignite Reuse
Best in #Database
Average in #Database
Top functions reviewed by kandi - BETA

kandi has reviewed ignite and discovered the below as its top functions. This is intended to give you an instant insight into ignite implemented functionality, and help decide if they suit your requirements.

  • Splits the cache by clearing the cache .
  • Ack of system properties .
  • Transforms an array to a collection using the provided closure .
  • Starts the active vacuums workers .
  • Writes the configuration to the binary writer .
  • Kills the cache .
  • returns compacted object
  • Create all nodes in zookeeper .
  • Process dynamic index information .
  • Rollback the transaction .

ignite Key Features

Technical Documentation

JavaDoc

C#/.NET APIs

C++ APIs

Scala APIs

Apache Ignite "Update of composite key column is not supported"

copy iconCopydownload iconDownload
IgniteCache<AffinityKey<Long>, Person> colPersonCache = Ignition.ignite().cache(PERSON_CACHE);

Person p1 = new Person(org1, "John", "Doe", 2000, "John Doe has Master Degree.");

colPersonCache.put(p1.key(), p1);
    colPersonCache.query(new SqlFieldsQuery(
        "INSERT INTO Person (id, orgId, firstName, lastName, salary, resume) " +
            "VALUES ( ?, ?, ?, ?, ?, ?)")
        .setArgs(6, 2, "first", "last", 1, "Master Degree")).getAll();
// the following line returns null, but you can use SQL to locate the record
colPersonCache.get(new AffinityKey<Long>(6L,2L)); 
colPersonCache.query(new SqlFieldsQuery(
            "INSERT INTO Person (_key, id, orgId, firstName, lastName, salary, resume) " +
                "VALUES (?, ?, ?, ?, ?, ?, ?)")
            .setArgs(new AffinityKey<Long>(6L,2L), 6, 2, "first", "last", 1, "Master Degree")).getAll();
colPersonCache.get(new AffinityKey<Long>(6L,2L)); 

//Person [id=6, orgId=2, lastName=last, firstName=first, salary=1.0, resume=Master Degree]
System.setProperty(IgniteSystemProperties.IGNITE_SQL_ALLOW_KEY_VAL_UPDATES, "true");
-----------------------
IgniteCache<AffinityKey<Long>, Person> colPersonCache = Ignition.ignite().cache(PERSON_CACHE);

Person p1 = new Person(org1, "John", "Doe", 2000, "John Doe has Master Degree.");

colPersonCache.put(p1.key(), p1);
    colPersonCache.query(new SqlFieldsQuery(
        "INSERT INTO Person (id, orgId, firstName, lastName, salary, resume) " +
            "VALUES ( ?, ?, ?, ?, ?, ?)")
        .setArgs(6, 2, "first", "last", 1, "Master Degree")).getAll();
// the following line returns null, but you can use SQL to locate the record
colPersonCache.get(new AffinityKey<Long>(6L,2L)); 
colPersonCache.query(new SqlFieldsQuery(
            "INSERT INTO Person (_key, id, orgId, firstName, lastName, salary, resume) " +
                "VALUES (?, ?, ?, ?, ?, ?, ?)")
            .setArgs(new AffinityKey<Long>(6L,2L), 6, 2, "first", "last", 1, "Master Degree")).getAll();
colPersonCache.get(new AffinityKey<Long>(6L,2L)); 

//Person [id=6, orgId=2, lastName=last, firstName=first, salary=1.0, resume=Master Degree]
System.setProperty(IgniteSystemProperties.IGNITE_SQL_ALLOW_KEY_VAL_UPDATES, "true");
-----------------------
IgniteCache<AffinityKey<Long>, Person> colPersonCache = Ignition.ignite().cache(PERSON_CACHE);

Person p1 = new Person(org1, "John", "Doe", 2000, "John Doe has Master Degree.");

colPersonCache.put(p1.key(), p1);
    colPersonCache.query(new SqlFieldsQuery(
        "INSERT INTO Person (id, orgId, firstName, lastName, salary, resume) " +
            "VALUES ( ?, ?, ?, ?, ?, ?)")
        .setArgs(6, 2, "first", "last", 1, "Master Degree")).getAll();
// the following line returns null, but you can use SQL to locate the record
colPersonCache.get(new AffinityKey<Long>(6L,2L)); 
colPersonCache.query(new SqlFieldsQuery(
            "INSERT INTO Person (_key, id, orgId, firstName, lastName, salary, resume) " +
                "VALUES (?, ?, ?, ?, ?, ?, ?)")
            .setArgs(new AffinityKey<Long>(6L,2L), 6, 2, "first", "last", 1, "Master Degree")).getAll();
colPersonCache.get(new AffinityKey<Long>(6L,2L)); 

//Person [id=6, orgId=2, lastName=last, firstName=first, salary=1.0, resume=Master Degree]
System.setProperty(IgniteSystemProperties.IGNITE_SQL_ALLOW_KEY_VAL_UPDATES, "true");
-----------------------
IgniteCache<AffinityKey<Long>, Person> colPersonCache = Ignition.ignite().cache(PERSON_CACHE);

Person p1 = new Person(org1, "John", "Doe", 2000, "John Doe has Master Degree.");

colPersonCache.put(p1.key(), p1);
    colPersonCache.query(new SqlFieldsQuery(
        "INSERT INTO Person (id, orgId, firstName, lastName, salary, resume) " +
            "VALUES ( ?, ?, ?, ?, ?, ?)")
        .setArgs(6, 2, "first", "last", 1, "Master Degree")).getAll();
// the following line returns null, but you can use SQL to locate the record
colPersonCache.get(new AffinityKey<Long>(6L,2L)); 
colPersonCache.query(new SqlFieldsQuery(
            "INSERT INTO Person (_key, id, orgId, firstName, lastName, salary, resume) " +
                "VALUES (?, ?, ?, ?, ?, ?, ?)")
            .setArgs(new AffinityKey<Long>(6L,2L), 6, 2, "first", "last", 1, "Master Degree")).getAll();
colPersonCache.get(new AffinityKey<Long>(6L,2L)); 

//Person [id=6, orgId=2, lastName=last, firstName=first, salary=1.0, resume=Master Degree]
System.setProperty(IgniteSystemProperties.IGNITE_SQL_ALLOW_KEY_VAL_UPDATES, "true");
-----------------------
IgniteCache<AffinityKey<Long>, Person> colPersonCache = Ignition.ignite().cache(PERSON_CACHE);

Person p1 = new Person(org1, "John", "Doe", 2000, "John Doe has Master Degree.");

colPersonCache.put(p1.key(), p1);
    colPersonCache.query(new SqlFieldsQuery(
        "INSERT INTO Person (id, orgId, firstName, lastName, salary, resume) " +
            "VALUES ( ?, ?, ?, ?, ?, ?)")
        .setArgs(6, 2, "first", "last", 1, "Master Degree")).getAll();
// the following line returns null, but you can use SQL to locate the record
colPersonCache.get(new AffinityKey<Long>(6L,2L)); 
colPersonCache.query(new SqlFieldsQuery(
            "INSERT INTO Person (_key, id, orgId, firstName, lastName, salary, resume) " +
                "VALUES (?, ?, ?, ?, ?, ?, ?)")
            .setArgs(new AffinityKey<Long>(6L,2L), 6, 2, "first", "last", 1, "Master Degree")).getAll();
colPersonCache.get(new AffinityKey<Long>(6L,2L)); 

//Person [id=6, orgId=2, lastName=last, firstName=first, salary=1.0, resume=Master Degree]
System.setProperty(IgniteSystemProperties.IGNITE_SQL_ALLOW_KEY_VAL_UPDATES, "true");
-----------------------
IgniteCache<AffinityKey<Long>, Person> colPersonCache = Ignition.ignite().cache(PERSON_CACHE);

Person p1 = new Person(org1, "John", "Doe", 2000, "John Doe has Master Degree.");

colPersonCache.put(p1.key(), p1);
    colPersonCache.query(new SqlFieldsQuery(
        "INSERT INTO Person (id, orgId, firstName, lastName, salary, resume) " +
            "VALUES ( ?, ?, ?, ?, ?, ?)")
        .setArgs(6, 2, "first", "last", 1, "Master Degree")).getAll();
// the following line returns null, but you can use SQL to locate the record
colPersonCache.get(new AffinityKey<Long>(6L,2L)); 
colPersonCache.query(new SqlFieldsQuery(
            "INSERT INTO Person (_key, id, orgId, firstName, lastName, salary, resume) " +
                "VALUES (?, ?, ?, ?, ?, ?, ?)")
            .setArgs(new AffinityKey<Long>(6L,2L), 6, 2, "first", "last", 1, "Master Degree")).getAll();
colPersonCache.get(new AffinityKey<Long>(6L,2L)); 

//Person [id=6, orgId=2, lastName=last, firstName=first, salary=1.0, resume=Master Degree]
System.setProperty(IgniteSystemProperties.IGNITE_SQL_ALLOW_KEY_VAL_UPDATES, "true");

Ignite Server Node with CacheJdbcPojoStore / Delay Client Node

copy iconCopydownload iconDownload
while (true) {
    // try get "myAtomic" and check its value
    IgniteAtomicLong atomicLong = ignite.atomicLong("myAtomic", 0, false);
    if (atomicLong != null && atomicLong.get() == 1) {
        
        // initialization is complete
        break;
    }

    // not ready
    Thread.sleep(1000);
}
...

//loading is complete, create atomic sequence and set its value to 1
ignite.atomicLong("myAtomic", 1, true);
...
-----------------------
while (true) {
    // try get "myAtomic" and check its value
    IgniteAtomicLong atomicLong = ignite.atomicLong("myAtomic", 0, false);
    if (atomicLong != null && atomicLong.get() == 1) {
        
        // initialization is complete
        break;
    }

    // not ready
    Thread.sleep(1000);
}
...

//loading is complete, create atomic sequence and set its value to 1
ignite.atomicLong("myAtomic", 1, true);
...

Can't change AllowOverwrite data streamer option for .NET apache ignite thin client

copy iconCopydownload iconDownload
var options = new DataStreamerClientOptions {AllowOverwrite = false};
    
using (var streamer = Client.GetDataStreamer<int, object>(cache.Name, options))
{
    ...
}

Isolated Ignite clusters on same set of machines

copy iconCopydownload iconDownload
static IgniteConfiguration GetConfig(int port, int portRange) =>
    new IgniteConfiguration
    {
        DiscoverySpi = new TcpDiscoverySpi
        {
            IpFinder = new TcpDiscoveryStaticIpFinder
            {
                Endpoints = new[]
                {
                    $"127.0.0.1:{port}..{port + portRange}"
                }
            },
            LocalPort = port,
            LocalPortRange = portRange
        },
        CommunicationSpi = new TcpCommunicationSpi
        {
            LocalPort = port - portRange,
            LocalPortRange = portRange
        },
        AutoGenerateIgniteInstanceName = true
    };

var clusterCfg1 = GetConfig(49500, 10);
var clusterCfg2 = GetConfig(49700, 10);

var cluster1Node1 = Ignition.Start(clusterCfg1);
var cluster1Node2 = Ignition.Start(clusterCfg1);

var cluster2Node1 = Ignition.Start(clusterCfg2);
var cluster2Node2 = Ignition.Start(clusterCfg2);
var cluster2Node3 = Ignition.Start(clusterCfg2);

Console.WriteLine("Cluster 1 nodes: " + cluster1Node1.GetCluster().GetNodes().Count);
Console.WriteLine("Cluster 2 nodes: " + cluster2Node1.GetCluster().GetNodes().Count);

Cluster 1 nodes: 2
Cluster 2 nodes: 3
-----------------------
static IgniteConfiguration GetConfig(int port, int portRange) =>
    new IgniteConfiguration
    {
        DiscoverySpi = new TcpDiscoverySpi
        {
            IpFinder = new TcpDiscoveryStaticIpFinder
            {
                Endpoints = new[]
                {
                    $"127.0.0.1:{port}..{port + portRange}"
                }
            },
            LocalPort = port,
            LocalPortRange = portRange
        },
        CommunicationSpi = new TcpCommunicationSpi
        {
            LocalPort = port - portRange,
            LocalPortRange = portRange
        },
        AutoGenerateIgniteInstanceName = true
    };

var clusterCfg1 = GetConfig(49500, 10);
var clusterCfg2 = GetConfig(49700, 10);

var cluster1Node1 = Ignition.Start(clusterCfg1);
var cluster1Node2 = Ignition.Start(clusterCfg1);

var cluster2Node1 = Ignition.Start(clusterCfg2);
var cluster2Node2 = Ignition.Start(clusterCfg2);
var cluster2Node3 = Ignition.Start(clusterCfg2);

Console.WriteLine("Cluster 1 nodes: " + cluster1Node1.GetCluster().GetNodes().Count);
Console.WriteLine("Cluster 2 nodes: " + cluster2Node1.GetCluster().GetNodes().Count);

Cluster 1 nodes: 2
Cluster 2 nodes: 3

What is a &quot;closure&quot; in Julia?

copy iconCopydownload iconDownload
julia> function est_mean(x)
           function fun(m)
               return m - mean(x)
           end
           val = find_zero(fun, 0.0)
           @show val, mean(x)
           return fun # explicitly return the inner function to inspect it
       end
est_mean (generic function with 1 method)

julia> x = rand(10)
10-element Vector{Float64}:
 0.6699650145575134
 0.8208379672036165
 0.4299946498764684
 0.1321653923513042
 0.5552854476018734
 0.8729613266067378
 0.5423030870674236
 0.15751882823315777
 0.4227087678654101
 0.8594042895489912

julia> fun = est_mean(x)
(val, mean(x)) = (0.5463144770912497, 0.5463144770912497)
fun (generic function with 1 method)

julia> dump(fun)
fun (function of type var"#fun#3"{Vector{Float64}})
  x: Array{Float64}((10,)) [0.6699650145575134, 0.8208379672036165, 0.4299946498764684, 0.1321653923513042, 0.5552854476018734, 0.8729613266067378, 0.5423030870674236, 0.15751882823315777, 0.4227087678654101, 0.8594042895489912]

julia> fun.x
10-element Vector{Float64}:
 0.6699650145575134
 0.8208379672036165
 0.4299946498764684
 0.1321653923513042
 0.5552854476018734
 0.8729613266067378
 0.5423030870674236
 0.15751882823315777
 0.4227087678654101
 0.8594042895489912

julia> fun(10)
9.453685522908751
julia> function gen()
          x = []
          return v -> push!(x, v)
       end
gen (generic function with 1 method)

julia> fun2 = gen()
#4 (generic function with 1 method)

julia> fun2.x
Any[]

julia> fun2(1)
1-element Vector{Any}:
 1

julia> fun2.x
1-element Vector{Any}:
 1

julia> fun2(100)
2-element Vector{Any}:
   1
 100

julia> fun2.x
2-element Vector{Any}:
   1
 100
-----------------------
julia> function est_mean(x)
           function fun(m)
               return m - mean(x)
           end
           val = find_zero(fun, 0.0)
           @show val, mean(x)
           return fun # explicitly return the inner function to inspect it
       end
est_mean (generic function with 1 method)

julia> x = rand(10)
10-element Vector{Float64}:
 0.6699650145575134
 0.8208379672036165
 0.4299946498764684
 0.1321653923513042
 0.5552854476018734
 0.8729613266067378
 0.5423030870674236
 0.15751882823315777
 0.4227087678654101
 0.8594042895489912

julia> fun = est_mean(x)
(val, mean(x)) = (0.5463144770912497, 0.5463144770912497)
fun (generic function with 1 method)

julia> dump(fun)
fun (function of type var"#fun#3"{Vector{Float64}})
  x: Array{Float64}((10,)) [0.6699650145575134, 0.8208379672036165, 0.4299946498764684, 0.1321653923513042, 0.5552854476018734, 0.8729613266067378, 0.5423030870674236, 0.15751882823315777, 0.4227087678654101, 0.8594042895489912]

julia> fun.x
10-element Vector{Float64}:
 0.6699650145575134
 0.8208379672036165
 0.4299946498764684
 0.1321653923513042
 0.5552854476018734
 0.8729613266067378
 0.5423030870674236
 0.15751882823315777
 0.4227087678654101
 0.8594042895489912

julia> fun(10)
9.453685522908751
julia> function gen()
          x = []
          return v -> push!(x, v)
       end
gen (generic function with 1 method)

julia> fun2 = gen()
#4 (generic function with 1 method)

julia> fun2.x
Any[]

julia> fun2(1)
1-element Vector{Any}:
 1

julia> fun2.x
1-element Vector{Any}:
 1

julia> fun2(100)
2-element Vector{Any}:
   1
 100

julia> fun2.x
2-element Vector{Any}:
   1
 100
-----------------------
struct LikelihoodClosure
    X
    y
end

(l::LikelihoodClosure)(β) = -log_likelihood(l.X, l.y, β)
make_closures(X, y) = LikelihoodClosure(X, y)
nll = make_closures(X, y)
julia> f(x) = y -> x + y
f (generic function with 1 method)

julia> f(1) # that's the closure value
#1 (generic function with 1 method)

julia> typeof(f(1)) # that's the closure type
var"#1#2"{Int64}

julia> f(1).x
1

julia> propertynames(f(1)) # behold, it has a field `x`!
(:x,)
julia> eval(Expr(:new, var"#1#2"{Int64}, 22))
#1 (generic function with 1 method)

julia> eval(Expr(:new, var"#1#2"{Int64}, 22))(2)
24
-----------------------
struct LikelihoodClosure
    X
    y
end

(l::LikelihoodClosure)(β) = -log_likelihood(l.X, l.y, β)
make_closures(X, y) = LikelihoodClosure(X, y)
nll = make_closures(X, y)
julia> f(x) = y -> x + y
f (generic function with 1 method)

julia> f(1) # that's the closure value
#1 (generic function with 1 method)

julia> typeof(f(1)) # that's the closure type
var"#1#2"{Int64}

julia> f(1).x
1

julia> propertynames(f(1)) # behold, it has a field `x`!
(:x,)
julia> eval(Expr(:new, var"#1#2"{Int64}, 22))
#1 (generic function with 1 method)

julia> eval(Expr(:new, var"#1#2"{Int64}, 22))(2)
24
-----------------------
struct LikelihoodClosure
    X
    y
end

(l::LikelihoodClosure)(β) = -log_likelihood(l.X, l.y, β)
make_closures(X, y) = LikelihoodClosure(X, y)
nll = make_closures(X, y)
julia> f(x) = y -> x + y
f (generic function with 1 method)

julia> f(1) # that's the closure value
#1 (generic function with 1 method)

julia> typeof(f(1)) # that's the closure type
var"#1#2"{Int64}

julia> f(1).x
1

julia> propertynames(f(1)) # behold, it has a field `x`!
(:x,)
julia> eval(Expr(:new, var"#1#2"{Int64}, 22))
#1 (generic function with 1 method)

julia> eval(Expr(:new, var"#1#2"{Int64}, 22))(2)
24

Apache Ignite 'Failed to prepare update plan' when executing SQL query on cache

copy iconCopydownload iconDownload
var cache01 = igniteClient.CreateCache<long, ValueClass>(new CacheConfiguration()
            {
                Name = "Cache01",
                QueryEntities = new[]
                {
                    new QueryEntity(
                        typeof(long),
                        typeof(ValueClass))
                    {
                        TableName = "table01",
                        KeyFieldName = "Id",
                        Fields = new List<QueryField>()
                        {
                                new QueryField("Id", typeof(long)),
                                new QueryField("Content", typeof(string)),
                        }
                    }
                },
                SqlSchema = "PUBLIC",
            });

Apache Ignite unexpectedly deletes IgniteSet

copy iconCopydownload iconDownload
IgniteCache<String, String> cache = igniteInstance.getOrCreateCache(configuration);
if (cache != null) {
    if (cache.containsKey(user)) {
        finalModelTag = modelTag;
    }
} else {
    throw new CacheException("`getOrCreateCache()` method in Ignite component returned null.");
}
val cacheConfiguration = new CacheConfiguration[String, String]()
cacheConfiguration.setBackups(2)
cacheConfiguration.setGroupName("some-group-name")
cacheConfiguration.setName(cacheName)
-----------------------
IgniteCache<String, String> cache = igniteInstance.getOrCreateCache(configuration);
if (cache != null) {
    if (cache.containsKey(user)) {
        finalModelTag = modelTag;
    }
} else {
    throw new CacheException("`getOrCreateCache()` method in Ignite component returned null.");
}
val cacheConfiguration = new CacheConfiguration[String, String]()
cacheConfiguration.setBackups(2)
cacheConfiguration.setGroupName("some-group-name")
cacheConfiguration.setName(cacheName)

Apache ignite docker 'image' not compatible on Apple M1 Max

copy iconCopydownload iconDownload
docker run --platform linux/amd64 -p 10800:10800 apacheignite/ignite:2.11.1 

How to get Header Authorization on code igniter 4?

copy iconCopydownload iconDownload
RewriteEngine On    
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
$this->request->getServer('HTTP_AUTHORIZATION')
Bearer eyJ....
-----------------------
RewriteEngine On    
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
$this->request->getServer('HTTP_AUTHORIZATION')
Bearer eyJ....
-----------------------
RewriteEngine On    
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
$this->request->getServer('HTTP_AUTHORIZATION')
Bearer eyJ....
-----------------------
# Disable directory browsing
Options All -Indexes

# ----------------------------------------------------------------------
# Rewrite engine
# ----------------------------------------------------------------------

# Turning on the rewrite engine is necessary for the following rules and features.
# FollowSymLinks must be enabled for this to work.
<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On

    # If you installed CodeIgniter in a subfolder, you will need to
    # change the following line to match the subfolder you need.
    # http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
    # RewriteBase /

    # Redirect Trailing Slashes...
    RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Rewrite "www.example.com -> example.com"
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]

    # Checks to see if the user is attempting to access a valid file,
    # such as an image or css document, if this isn't true it sends the
    # request to the front controller, index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]

    # Ensure Authorization header is passed along
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    ErrorDocument 404 index.php
</IfModule>

# Disable server signature start
    ServerSignature Off
# Disable server signature end
$authorization = apache_request_headers()["Authorization"];
-----------------------
# Disable directory browsing
Options All -Indexes

# ----------------------------------------------------------------------
# Rewrite engine
# ----------------------------------------------------------------------

# Turning on the rewrite engine is necessary for the following rules and features.
# FollowSymLinks must be enabled for this to work.
<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On

    # If you installed CodeIgniter in a subfolder, you will need to
    # change the following line to match the subfolder you need.
    # http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
    # RewriteBase /

    # Redirect Trailing Slashes...
    RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Rewrite "www.example.com -> example.com"
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]

    # Checks to see if the user is attempting to access a valid file,
    # such as an image or css document, if this isn't true it sends the
    # request to the front controller, index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]

    # Ensure Authorization header is passed along
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    ErrorDocument 404 index.php
</IfModule>

# Disable server signature start
    ServerSignature Off
# Disable server signature end
$authorization = apache_request_headers()["Authorization"];

apache ignite java thin client expired entry listener

copy iconCopydownload iconDownload
query.setIncludeExpired(true)

Community Discussions

Trending Discussions on ignite
  • Apache Ignite &quot;Update of composite key column is not supported&quot;
  • Apache ignite startup failure
  • Ignite Server Node with CacheJdbcPojoStore / Delay Client Node
  • Can't change AllowOverwrite data streamer option for .NET apache ignite thin client
  • Isolated Ignite clusters on same set of machines
  • What is a &quot;closure&quot; in Julia?
  • Why does Apache Ignite use more memory than configured
  • Apache Ignite 'Failed to prepare update plan' when executing SQL query on cache
  • Apache Ignite unexpectedly deletes IgniteSet
  • Apache ignite docker 'image' not compatible on Apple M1 Max
Trending Discussions on ignite

QUESTION

Apache Ignite &quot;Update of composite key column is not supported&quot;

Asked 2022-Mar-28 at 11:06

I have a cache with an AffinityKey as Key and want to insert an entry. If i try to insert the entry using a SQL-Insert statement i get an exception stating "Update of composite key column is not supported" which i guess is because the AffinityKey is a composite key. On https://ignite.apache.org/docs/latest/SQL/indexes#indexing-nested-objects i have read that if you are using indexed nested objects you will no longer be able to use insert or update statements but it is not mentioned on https://ignite.apache.org/docs/latest/data-modeling/affinity-collocation for composite keys.

Does using composite keys also cause insert and update statements to no longer be usable or am i missing something?

Example:

// creating cache using QueryEntities
cache = ignite.CreateCache<AffinityKey, MyClass>(new CacheClientConfiguration(cacheConfiguration)
  {
    Name = "MyCache",
    QueryEntities = new[]
    {
      new QueryEntity(typeof(AffinityKey), typeof(MyClass)){ TableName = "MyTable" }
    },
  });

// insert statement
cache.Query(
  new SqlFieldsQuery(
    "INSERT INTO " +
      "MyTable ( " +
        "_key, " +
        $"{nameof(MyClass.Text)} ) " +
      "VALUES ( " +
        "?, " +
        "? )"
  )
  {
    Arguments = new object[]
    {
      new AffinityKey("Key1", "AffinityKey1"),
      "TextValue"
    },
  });

Solution: As described below by @Alexandr Shapkin, setting "IGNITE_SQL_ALLOW_KEY_VAL_UPDATES" to true makes it possible to update entries via SQL that have been added using a composite key.

For anyone interested https://ignite.apache.org/docs/latest/setup#setting-ignite-system-properties shows how to list available ignite properties/environment variables with a brief description.

ANSWER

Answered 2022-Mar-25 at 23:59

You are mixing the concepts.

In Apache Ignite you can access or insert your data multiple ways. One would be to use Cache API, like cache#get, cache#put, another option would be - using SQL, like INSERT, SELECT, etc.

Since eventually everything is just a key-value pair undeneath, Ignite provide a special SQL _key and _val properties to access the corresponded values.

The thing is - if you don't need to use Cache API and SQL interchangeably and are OK using only, say, SQL, you don't set _key at all.

On the other hand, if you need to use both APIs, say, defined with QueryEntity just like in your example, you need to specify _key field properly.

Consider this example:

IgniteCache<AffinityKey<Long>, Person> colPersonCache = Ignition.ignite().cache(PERSON_CACHE);

Person p1 = new Person(org1, "John", "Doe", 2000, "John Doe has Master Degree.");

colPersonCache.put(p1.key(), p1);

...

it's fine to do this:

    colPersonCache.query(new SqlFieldsQuery(
        "INSERT INTO Person (id, orgId, firstName, lastName, salary, resume) " +
            "VALUES ( ?, ?, ?, ?, ?, ?)")
        .setArgs(6, 2, "first", "last", 1, "Master Degree")).getAll();

But in that case, you won't be able to locate the record using cache API:

// the following line returns null, but you can use SQL to locate the record
colPersonCache.get(new AffinityKey<Long>(6L,2L)); 

But if you use _key:

colPersonCache.query(new SqlFieldsQuery(
            "INSERT INTO Person (_key, id, orgId, firstName, lastName, salary, resume) " +
                "VALUES (?, ?, ?, ?, ?, ?, ?)")
            .setArgs(new AffinityKey<Long>(6L,2L), 6, 2, "first", "last", 1, "Master Degree")).getAll();

Cache API now does return the value:

colPersonCache.get(new AffinityKey<Long>(6L,2L)); 

//Person [id=6, orgId=2, lastName=last, firstName=first, salary=1.0, resume=Master Degree]

Note.

There is a special restriction to avoid possible key desync, and in order to make the latest query (and the original in the question) work, you have to set the following enviroment property:

System.setProperty(IgniteSystemProperties.IGNITE_SQL_ALLOW_KEY_VAL_UPDATES, "true");

Source https://stackoverflow.com/questions/71619576

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install ignite

You can install using 'pip install ignite' or download it from GitHub, PyPI.
You can use ignite like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the ignite component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

Support

Apache Ignite comes with a ANSI-99 compliant, horizontally scalable, and fault-tolerant SQL engine that allows you to interact with Ignite as with a regular SQL database using JDBC, ODBC drivers, or native SQL APIs available for Java, C#, C++, Python, and other programming languages. Ignite supports all DML commands, including SELECT, UPDATE, INSERT, and DELETE queries as well as a subset of DDL commands relevant for distributed systems.

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Compare Database Libraries with Highest Support
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.