Re: C# CacheStoreAdapter - Customizing Load, LoadCache methods

2020-11-24 Thread ABDumalagan
I see - do you have any suggestions of how I can work around the bottleneck
and speed up data loading into cache? 



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: C# CacheStoreAdapter - Customizing Load, LoadCache methods

2020-11-24 Thread ABDumalagan
So I am currently running  this
  
code to just pull all the rows from the underlying database, and the
diagnostic session is hitting 20 mins and counting - 
Is this definitively a database issue or is it in the way I've written the
code?




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: C# CacheStoreAdapter - Customizing Load, LoadCache methods

2020-11-24 Thread ABDumalagan
I'll try a local scenario and stream with fake data right now, but how would
I check to see if the underlying database is a bottleneck? 



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: C# CacheStoreAdapter - Customizing Load, LoadCache methods

2020-11-24 Thread ABDumalagan
I see - I'm actually going to scrap the LoadCache approach and implement your
suggestion of DataStream - I just have a couple of questions regarding that:

1) Is it possible to use both DataStream and CacheStoreFactory together?

2) Right now, my  Program.cs
   of
DataStream is naïve and loads 1000 entries in ~7 seconds, 1 entries in
~55 seconds, and 10 entries in 9 mins and 12 seconds 
Is this a normal time for loading bulk entries?
Is there another way I can implement or configure DataStream to load bulk
entries faster? I think at this rate, loading > 500,000 entries will be
pushing around an hour. 




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: C# CacheStoreAdapter - Customizing Load, LoadCache methods

2020-11-23 Thread ABDumalagan
1. I currently just have 2 Ignite nodes--first one remotely to start the
cluster and the second one (this one) started programmatically with C#.
2. Adding Thread.Sleep(5000) doesn't change the result, unfortunately.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: C# CacheStoreAdapter - Customizing Load, LoadCache methods

2020-11-23 Thread ABDumalagan
1. Your program worked for me!

2. I added something to my LoadCache(Action, params object[]
args) method in OracleStore.cs. I added the following 3 lines after the
while loop: 
reader.Dispose();
cmd.Dispose();
con.Dispose();
Console returned a non-zero cache size of 5136, however, the queries I
wanted to do and the queries counted by the method is 10,000 - I was
wondering what happened to the other ~5000 queries and why they aren't in
cache? 




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: C# CacheStoreAdapter - Customizing Load, LoadCache methods

2020-11-22 Thread ABDumalagan
I see - am I dealing with 1.) in my case?
When I hover over the method LoadCache(Action, params
object[] args)  in Visual Studio, it says that *"...This method is called
whenever
Apache.Ignite.Core.Cache.ICache.LocalLoadCache(Apache.Ignite.Core.Cache.ICacheEntryFilter,
params object[]) method is invoked which is usually to preload the cache
from persistent storage"*.
 
>From the  .NET docs

 
, it says that for LocalLoadCache(ICacheEntryFilter, Object[]), the
loaded values will then be given to the optionally passed in predicate, and,
if the predicate returns true, will be stored in cache. If predicate is
null, then all loaded values will be stored in cache. 
In my case, I call cache.LocalLoadCache(null) in  Program.cs
  ,
where it then calls on LoadCache(Action act, params object[]
args) in  OracleStore.cs
  
and the Associate IDs are being printed to console. 
However, when I try to print the cache size in console, it returns 0 - does
this mean that the values are not being stored in cache?
Do I need to do something else to make sure the values are loaded into
cache? I thought that LocalLoadCache would just put all the values queried
from the underlying storage into cache.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: C# CacheStoreAdapter - Customizing Load, LoadCache methods

2020-11-21 Thread ABDumalagan
Got *(1)* to work - thank you!
However, for *(2)*, I tried to implement a test Action delegate that writes
the value of the entry in the console and I got an error stating: 
Argument 1: cannot convert from 'System.Action'
to 'Apache.Ignite.Core.Cache.ICacheEntryFilter'
This error occurred at line cache.Load(action, null)
Am I going about this implementation the wrong way? If so, what would I need
to do to correct this? 


Updated files: 
Runs program; test Action delegate: Program.cs
  
Inherits CacheStoreAdapter:  OracleStore.cs
   




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

C# CacheStoreAdapter - Customizing Load, LoadCache methods

2020-11-20 Thread ABDumalagan
Hello, 
I have some confusion about implementing my own Load and LoadCache methods - 
I am trying to load data from an underlying Oracle database into cache, and
the entries are key-value pairs where the key is the Associate ID and the
value is the entire Associate object. 
*(1)* Regarding the Load method, I was under the impression that calling
Get(key) would inherently call the Load(key) method from my OracleStore.cs
file and load the key and corresponding object from the database into cache. 
Under the Load method in OracleStore.cs, I connect to the underlying Oracle
database and execute a query which grabs the data that correlates to the
Associate ID.
However, after running my Program.cs file, I received an error saying
*"System.Collections.Generic.KeyNotFoundException: 'The given key was not
present in the cache: 18755"* -- was I under the wrong impression that the
Load(key) would just put the data into cache? 
I know that the Load method returns an object, and in my case, it returns an
Associate object. However, do I need to do implement something else in order
to put the object returned from the Load method into cache?
*(2)* With the LoadCache method, I essentially would be doing the same thing
as the Load method, but this time, I would be querying 10,000 entries from
the database and putting it into cache. I also hold the same assumption that
calling the LoadCache method will just load the 10,000 entries in cache.
Also, I am unsure about what to do for the Action parameter in
LoadCache(Action, Object[])--would I need to define a method to pass
as a parameter, and would that method be responsible for putting the entries
in cache? If so, how would I go about it? 
 
Files attached below:
Inherits CacheStoreAdapter:  OracleStore.cs
  
Inherits IFactory:  OracleStoreFactory.cs

  
Establishes Oracle database connection:  DBConnection.cs
  
Defines Associate object:  Associate.cs
  
Runs program (creates and starts node):  Program.cs
  




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

C# SQL API on key-value entries in cache error

2020-11-18 Thread ABDumalagan
Hello, 
I ran into some errors trying to use Apache Ignite's SQL API, specifically
the  @QueryAnnotation
  
and  executing a query
  . 
Right now, I start a cluster remotely with an XML file. Then, I start
another node locally and programmatically with C# that connects to an
underlying Oracle database in order to load the cache with data. The entries
in the cache are key-value pairs, where the key is an Associate ID and the
value is the entire Associate object.
My objective is to be able to query the data in cache. The steps I've done
so far was to annotate the fields in the value class definition with the
@QuerySqlField annotation in Associate.cs , instantiate the QueryEntity in
CacheConfiguration in Program.cs, and perform a query using SqlFieldsQuery
in Program.cs
The error that I'm running into is: 
'Failed to parse query. Table "DEFAULT" not found; SQL statement:SELECT
Associate_ID FROM default [42102-197]'
Am I running into this error because my entries are in key-value pairs? Do I
need to organize the entries in my cache into a SQL table?
The code is attached as a file here:
Program.cs
  
Associate.cs
  
 Thank you!




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Server created remotely, C# client not able to connect to cluster with IP address

2020-11-10 Thread ABDumalagan
I see--
If I were to scrap the client/server idea entirely, what changes would I
need to make in order to connect a node created locally and programmatically
with C# with an IP address of DEF to a node created remotely on another
computer with an IP address of ABC?




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Server created remotely, C# client not able to connect to cluster with IP address

2020-11-09 Thread ABDumalagan
I am starting a cluster through another computer via PuTTY, and I was
wondering how to connect a local node started programmatically with C# to
the cluster? 


Right now, I am running into errors with what I have--

I start an ignite server remotely with the script bash
ignite.shC:\..\\..\config\example-test-connection.xml


*XML Config File*


http://www.springframework.org/schema/beans;
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd;>



















IpAddress:47500..47509










And the *program *I'm trying to run that creates a client node to connect
with
the cluster:

var cfg = new IgniteClientConfiguration
{
Endpoints = new[] { "171.159.66.12" }
};

try
{
using (IIgniteClient client = Ignition.StartClient(cfg))
{
ICacheClient cache = client.GetCache("name");
cache.Put(1, "Hello World!");
Console.WriteLine("Added a value to the cache!");
}
}
catch(Exception ex)
{
Console.WriteLine(ex);
}


The *error(s) *I'm getting:

System.AggregateException: Failed to establish Ignite thin client
connection, examine inner exceptions for details. (A connection attempt
failed because the connected party did not properly respond after a period
of time, or established connection failed because connected host has failed
to respond. 171.159.66.12:10800)
 ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException
(10060): A connection attempt failed because the connected party did not
properly respond after a period of time, or established connection failed
because connected host has failed to respond. 171.159.66.12:10800
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at
Apache.Ignite.Core.Impl.Client.ClientSocket.Connect(IgniteClientConfiguration
cfg, EndPoint endPoint, ILogger logger)
   at
Apache.Ignite.Core.Impl.Client.ClientSocket..ctor(IgniteClientConfiguration
clientConfiguration, EndPoint endPoint, String host, Nullable`1 version,
Action`1 topVerCallback, Marshaller marshaller)
   at
Apache.Ignite.Core.Impl.Client.ClientFailoverSocket.Connect(SocketEndpoint
endPoint)
   at Apache.Ignite.Core.Impl.Client.ClientFailoverSocket.GetNextSocket()
   --- End of inner exception stack trace ---
   at Apache.Ignite.Core.Impl.Client.ClientFailoverSocket.GetNextSocket()
   at Apache.Ignite.Core.Impl.Client.ClientFailoverSocket.Connect()
   at
Apache.Ignite.Core.Impl.Client.ClientFailoverSocket..ctor(IgniteClientConfiguration
config, Marshaller marsh)
   at
Apache.Ignite.Core.Impl.Client.IgniteClient..ctor(IgniteClientConfiguration
clientConfiguration)
   at Apache.Ignite.Core.Ignition.StartClient(IgniteClientConfiguration
clientConfiguration)
   at IgniteTest.Program.Main(String[] args) in
C:\Users\zk5gdcj\source\repos\Apache_Ignite\Testing\Getting_Started\IgniteTest\IgniteTest\Program.cs:line
85

--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Server node started via PuTTY, C# client not able to connect to cluster

2020-11-09 Thread ABDumalagan
I am starting a cluster through another computer via PuTTY, and I was
wondering how to connect a local node started programmatically with C# to
the cluster? 


Right now, I am running into errors with what I have--

I start an ignite server remotely with the script bash
ignite.shC:\..\\..\config\example-test-connection.xml

The XML configuration file looks like this:


http://www.springframework.org/schema/beans;
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd;>



















171.159.66.12:47500..47509










And the program I'm trying to run that creates a client node to connect with
the cluster:

var cfg = new IgniteClientConfiguration
{
Endpoints = new[] { "171.159.66.12" }
};

try
{
using (IIgniteClient client = Ignition.StartClient(cfg))
{
ICacheClient cache = client.GetCache("name");
cache.Put(1, "Hello World!");
Console.WriteLine("Added a value to the cache!");
}
}
catch(Exception ex)
{
Console.WriteLine(ex);
}




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Connecting to RDBMS - Failed to instantiate Spring XML application context

2020-11-05 Thread ABDumalagan
Hello all,

This is my first time using Apache Ignite, and I am working directly with
the given example configuration files in the binary release folder. 

Currently I am using PuTTY, and my objective is to load data from an
existing Oracle database into cache. The first and only step I've taken
right now is to create my own XML file with the  CacheJdbcBlobStore
configurations

 
, and I pass the file as a parameter to the script /bash ignite [file
path]/. 

The error I get is class /org.apache.ignite.IgniteException: Failed to
instantiate Spring XML application context/, and I think it's caused by
/org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find
class/

I have tried to  set and export USER_LIBS to the
apache-ignite-2.8.1-bin/benchmarks/libs file path, however I still get the
same error. 

Below I have my XML file config and error log - any advice or help is
appreciated! 


*XML File
*

http://www.springframework.org/schema/beans;
       xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
       xsi:schemaLocation=
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd;>
    
        
        
        
    
    
        
            
               
                
                    
                    
                        
                        
                        
                    
                
            
        

       
        
            
                
                   
                   
                    
                        
                            
                               
                                127.0.0.1:47500..47509
                            
                        
                    
                
            
        
    



*Error*

class org.apache.ignite.IgniteException: Failed to instantiate Spring XML
application context (make sure all classes used in Spring configuration are
present at CLASSPATH)
[springUrl=file:/app/apache/apache-ignite-2.8.1-bin/examples/config/example-cache-blob-store.xml]
        at
org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:1067)
        at org.apache.ignite.Ignition.start(Ignition.java:349)
        at
org.apache.ignite.startup.cmdline.CommandLineStartup.main(CommandLineStartup.java:300)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to
instantiate Spring XML application context (make sure all classes used in
Spring configuration are present at CLASSPATH)
[springUrl=file:/app/apache/apache-ignite-2.8.1-bin/examples/config/example-cache-blob-store.xml]
        at
org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.applicationContext(IgniteSpringHelperImpl.java:387)
        at
org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.loadConfigurations(IgniteSpringHelperImpl.java:104)
        at
org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.loadConfigurations(IgniteSpringHelperImpl.java:98)
        at
org.apache.ignite.internal.IgnitionEx.loadConfigurations(IgnitionEx.java:710)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:911)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:820)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:690)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:659)
        at org.apache.ignite.Ignition.start(Ignition.java:346)
        ... 1 more
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException:
Cannot find class [com.mysql.jdbc.jdbc2.optional.MysqlDataSource] for bean
with name 'mysqlDataSource' defined in URL
[file:/app/apache/apache-ignite-2.8.1-bin/examples/config/example-cache-blob-store.xml];
nested exception is java.lang.ClassNotFoundException:
com.mysql.jdbc.jdbc2.optional.MysqlDataSource
        at
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1397)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:638)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:607)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1496)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1018)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:737)
        at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
        at