Re: Kafka Streamer

2016-10-24 Thread Anil
No Val. A message cannot be converted into number of cache entries using
value decoder. am i wrong ?

Thanks.

On 25 October 2016 at 02:42, vkulichenko 
wrote:

> Hi,
>
> There are keyDecoder and valueDecoder that you can specify when creating
> the
> KafkaStreamer. Is that what you're looking for?
>
> -Val
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Kafka-Streamer-tp8432p8447.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Re: Ignite client thread amount control

2016-10-24 Thread Jeff Jiao
Hi vkulichenko,

Thanks for the reply! I already subscribed.

What if I have multiple users query at the same time? One user hold the
Ignite client and the others just wait?



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Ignite-client-thread-amount-control-tp8434p8455.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


How to avoid data skew in collocate data with data

2016-10-24 Thread ght230
I had put my data into 3 nodes with collocate data with data, and found the
data is not evenly distributed across the three nodes.
Node A save 30 pieces of data, Node B save 30 pieces of data, and Node C
saved 900 pieces of data.

The example data as following:
NodeAffinityKey count
A   530 9
A   531 10
A   532 11
B   540 12
B   541 14
B   542 4
C   550 100
C   551 200
C   552 50
C   553 400
C   554 150

How to make the data evenly distributed in the three nodes?




--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-avoid-data-skew-in-collocate-data-with-data-tp8454.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: How to continuously subscribe for event?

2016-10-24 Thread suhuadong
hi Manu,
My code contain't "return true".
I omit the code when  I copy the code to textbox. 



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-continuously-subscribe-for-event-tp8438p8453.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: expired policy didn't work

2016-10-24 Thread Alec Lee
The server I did experiment is not a decent one, I set the duration as 2/3 
mins, my plan to check it by zeppelin query by count the all entries which 
should not be varying too much, and 
select * from cache order by timestamp desc limit 10, that I can see the 
timestamp is updating. 

However, count keeps growing till the node is down. 

thanks


> On Oct 24, 2016, at 2:15 PM, vkulichenko  
> wrote:
> 
> Hi,
> 
> What is the duration you provided and how do you check that expiration
> actually happened? It's not very clear how your test works, can you provide
> the working class that I can execute?
> 
> Also note that you have swap space enabled, so if an entry is expired and
> evicted from the cache, it will be unswapped back on get(), so you will
> still be able to read the value.
> 
> -Val
> 
> 
> 
> --
> View this message in context: 
> http://apache-ignite-users.70518.x6.nabble.com/expired-policy-didn-t-work-tp8419p8448.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.



Re: Killing a node under load stalls the grid with ignite 1.7

2016-10-24 Thread bintisepaha
Hi, actually we use a lot of caches from cache store writeAll().
For confirming if that is the cause of the grid stall, we would have to
completely change our design. 

Can someone confirm that this is the cause for grid to stall? referencing
cache.get from a cache store and then killing or bringing up nodes leads to
a stall?

We see a node blocked on flusher thread while doing a cache.get() when the
grid is stalled, if we kill that node, the grid starts functioning. But we
would like to understand are we using write behind incorrectly or there are
some settings that we can use to re-balance or write-behind that might save
us from something like this.

Thanks,
Binti



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Killing-a-node-under-load-stalls-the-grid-with-ignite-1-7-tp8130p8449.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Kafka Streamer

2016-10-24 Thread vkulichenko
Hi,

There are keyDecoder and valueDecoder that you can specify when creating the
KafkaStreamer. Is that what you're looking for?

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Kafka-Streamer-tp8432p8447.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Ignite client thread amount control

2016-10-24 Thread vkulichenko
Hi Jeff,

Please properly subscribe to the mailing list so that the community can
receive email notifications for your messages. To subscribe, send empty
email to user-subscr...@ignite.apache.org and follow simple instructions in
the reply.


Jeff Jiao wrote
> Every time when I start a Ignite client (using default settings), it
> generates about 60 threads.
> 
> My use case is:
> My service has an Ignite cache component which allows users to query from
> it.
> I write a IgniteQueryPool, this pool will initialize 5~10 ignite clients, 
> If user use my IgniteQueryPool, it will cause their client side thread
> amount become very large(add 300-600)
> Is there a way to control Ignite client thread amount?

Ignite instance is thread-safe and can be reused by all threads within a
single JVM. So there is no need to create a pool of clients in your
application. Just start one client and use it everywhere.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Ignite-client-thread-amount-control-tp8434p8446.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Random SSL unsupported record version

2016-10-24 Thread styriver
I apologize yes it is. It does have more information than the previous post.
The last suggestion from the group was to change the key size. I created
certificates at 1024 and still have the same issue.



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Random-SSL-unsupported-record-version-tp8406p8445.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: [EXTERNAL] Re: SLF4J AND LOG4J delegation exception with ignite dependency

2016-10-24 Thread chevy
My current dependency looks like below [1](I am getting error pop up in eclipse 
when I use name in exclude as you have suggested). But I still get the same 
exception [2] mentioned below -


1.  dependencies {

  compile ("org.apache.ignite:ignite-rest-http:1.7.0") {
exclude group: "org.slf4j"}

//compile 'org.slf4j:slf4j-api:1.7.21'
 compile("org.springframework.boot:spring-boot-starter-web")
  compile("org.springframework.boot:spring-boot-starter-jdbc")
 compile("org.springframework.boot:spring-boot-starter-data-jpa")
  compile("mysql:mysql-connector-java:5.1.34")

  // Ignite dependencies
 compile group: 'org.apache.ignite', name: 'ignite-core', version: '1.7.0'
 compile group: 'org.apache.ignite', name: 'ignite-spring', version: '1.7.0'
 compile group: 'org.apache.ignite', name: 'ignite-indexing', version: 
'1.7.0'
  compile group: 'org.apache.ignite', name: 'ignite-rest-http', version: 
'1.7.0'

  configurations {
runtime.exclude group: 'org.slf4j'
  }
}



2.   Exception:

java.lang.NoSuchMethodError: 
org.eclipse.jetty.util.log.StdErrLog.setProperties(Ljava/util/Properties;)V

at 
org.apache.ignite.internal.processors.rest.protocols.http.jetty.GridJettyRestProtocol.(GridJettyRestProtocol.java:72)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:264)

at 
org.apache.ignite.internal.processors.rest.GridRestProcessor.startHttpProtocol(GridRestProcessor.java:831)

at 
org.apache.ignite.internal.processors.rest.GridRestProcessor.start(GridRestProcessor.java:451)

at 
org.apache.ignite.internal.IgniteKernal.startProcessor(IgniteKernal.java:1589)

at 
org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:880)

at 
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1739)

at 
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1589)

at 
org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1042)

at 
org.apache.ignite.internal.IgnitionEx.startConfigurations(IgnitionEx.java:964)

at 
org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:850)

at 
org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:749)

at 
org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:619)

at 
org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:589)

at org.apache.ignite.Ignition.start(Ignition.java:347)

at com.boot.NodeStartup.main(NodeStartup.java:21)


--
Regards,
Chetan.

From: "vdpyatkov [via Apache Ignite Users]" 

Date: Monday, October 24, 2016 at 9:07 PM
To: "Chetan.V.Yadav" 
Subject: [EXTERNAL] Re: SLF4J AND LOG4J delegation exception with ignite 
dependency

Hi,

1) You can exclude slf4j-log4j12 dependency from ignite-rest-http.
Like this:
compile ('org.apache.ignite:ignite-rest-http:1.6.0') {
exclude group: "org.slf4j", name: "slf4j-log4j12"
  }

2) Ignite 1.6 supports h2 1.3 version. You need to use last version 1.7 of 
Ignite, with support h2 1.4.

On Sat, Oct 22, 2016 at 11:58 AM, chevy <[hidden 
email]> wrote:
1. Now I am getting below exception. Saw in one of the threads that removing
ignite-rest-http will solve the issue which it does. But I need to include
rest-api as I will be using ignite rest services. Please help me fix this.

java.lang.NoSuchMethodError:
org.eclipse.jetty.util.log.StdErrLog.setProperties(Ljava/util/Properties;)V
at
org.apache.ignite.internal.processors.rest.protocols.http.jetty.GridJettyRestProtocol.(GridJettyRestProtocol.java:72)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at
org.apache.ignite.internal.processors.rest.GridRestProcessor.startHttpProtocol(GridRestProcessor.java:831)
at
org.apache.ignite.internal.processors.rest.GridRestProcessor.start(GridRestProcessor.java:451)
at
org.apache.ignite.internal.IgniteKernal.startProcessor(IgniteKernal.java:1549)
at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:876)
at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1736)
at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1589)
at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1042)
at
org.apache.ignite.internal.IgnitionEx.startConfigurations(IgnitionEx.java:964)
at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:850)
at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:749)
at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:619)
at 

Re: SLF4J AND LOG4J delegation exception with ignite dependency

2016-10-24 Thread Vladislav Pyatkov
Hi,

1) You can exclude slf4j-log4j12 dependency from ignite-rest-http.
Like this:

compile ('org.apache.ignite:ignite-rest-http:1.6.0') {
exclude group: "org.slf4j", name: "slf4j-log4j12"
  }

2) Ignite 1.6 supports h2 1.3 version. You need to use last version 1.7 of
Ignite, with support h2 1.4.

On Sat, Oct 22, 2016 at 11:58 AM, chevy  wrote:

> 1. Now I am getting below exception. Saw in one of the threads that
> removing
> ignite-rest-http will solve the issue which it does. But I need to include
> rest-api as I will be using ignite rest services. Please help me fix this.
>
> java.lang.NoSuchMethodError:
> org.eclipse.jetty.util.log.StdErrLog.setProperties(Ljava/
> util/Properties;)V
> at
> org.apache.ignite.internal.processors.rest.protocols.http.jetty.
> GridJettyRestProtocol.(GridJettyRestProtocol.java:72)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:264)
> at
> org.apache.ignite.internal.processors.rest.GridRestProcessor.
> startHttpProtocol(GridRestProcessor.java:831)
> at
> org.apache.ignite.internal.processors.rest.GridRestProcessor.start(
> GridRestProcessor.java:451)
> at
> org.apache.ignite.internal.IgniteKernal.startProcessor(
> IgniteKernal.java:1549)
> at org.apache.ignite.internal.IgniteKernal.start(
> IgniteKernal.java:876)
> at
> org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(
> IgnitionEx.java:1736)
> at
> org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(
> IgnitionEx.java:1589)
> at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.
> java:1042)
> at
> org.apache.ignite.internal.IgnitionEx.startConfigurations(
> IgnitionEx.java:964)
> at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.
> java:850)
> at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.
> java:749)
> at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.
> java:619)
> at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.
> java:589)
> at org.apache.ignite.Ignition.start(Ignition.java:347)
> at com.boot.NodeStartup.main(NodeStartup.java:21)
>
> -
> 2. If I include ignite-indexing dependency (h2 is available in class path),
> I get below exception -
>
> java.lang.NoClassDefFoundError: org/h2/constant/SysProperties
> at
> org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.start(
> IgniteH2Indexing.java:1487)
> at
> org.apache.ignite.internal.processors.query.GridQueryProcessor.start(
> GridQueryProcessor.java:171)
> at
> org.apache.ignite.internal.IgniteKernal.startProcessor(
> IgniteKernal.java:1549)
> at org.apache.ignite.internal.IgniteKernal.start(
> IgniteKernal.java:869)
> at
> org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(
> IgnitionEx.java:1736)
> at
> org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(
> IgnitionEx.java:1589)
> at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.
> java:1042)
> at
> org.apache.ignite.internal.IgnitionEx.startConfigurations(
> IgnitionEx.java:964)
> at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.
> java:850)
> at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.
> java:749)
> at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.
> java:619)
> at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.
> java:589)
> at org.apache.ignite.Ignition.start(Ignition.java:347)
> at com.boot.NodeStartup.main(NodeStartup.java:21)
> Caused by: java.lang.ClassNotFoundException: org.h2.constant.SysProperties
> at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> ... 14 more
>
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/SLF4J-AND-LOG4J-delegation-exception-
> with-ignite-dependency-tp8415p8425.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 
Vladislav Pyatkov


Re: How to continuously subscribe for event?

2016-10-24 Thread Manu
Hi,

You need to return true on apply method to continuously listen.



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-continuously-subscribe-for-event-tp8438p8442.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Ignite Jdbc connection

2016-10-24 Thread Manu
If you use ignite jdbc driver, to ensure that you always get a valid ignite
instance before call a ignite operation I recommend to use a datasource
implementation that validates connection before calls and create new ones
otherwise.

For common operations with a ignite instance, I use this method to ensure a
*good* ignite instance and don´t waits or control reconnection... maybe
there are some other mechanisms... but who cares? ;)

public Ignite getIgnite() {
if (this.ignite!=null){
try{
//ensure this ignite instance is STARTED and 
connected
this.ignite.getOrCreateCache("default");
}catch (IllegalStateException e){
this.ignite=null;
}catch (IgniteClientDisconnectedException cause) {
this.ignite=null;
}catch (CacheException e) {
if (e.getCause() instanceof 
IgniteClientDisconnectedException) {
this.ignite=null;
}else if (e.getCause() instanceof
IgniteClientDisconnectedCheckedException) {
this.ignite=null;
}else{
throw e;
}
}
}
if (this.ignite==null){
this.createIgniteInstance();
}
return ignite;
}

also you can wait for reconnection using this catch block instead of
above... but as I said... who cares?... sometimes reconnection waits are not
desirable...
[...]
   try{
//ensure this ignite instance is STARTED and 
connected
this.ignite.getOrCreateCache("default");
}catch (IllegalStateException e){
this.ignite=null;
}catch (IgniteClientDisconnectedException cause) {
LOG.warn("Client disconnected from cluster. Waiting for 
reconnect...");
cause.reconnectFuture().get(); // Wait for reconnect.
}catch (CacheException e) {
if (e.getCause() instanceof 
IgniteClientDisconnectedException) {
LOG.warn("Client disconnected from cluster. 
Waiting for reconnect...");
IgniteClientDisconnectedException cause =
(IgniteClientDisconnectedException)e.getCause();
cause.reconnectFuture().get(); // Wait for 
reconnect.
}else if (e.getCause() instanceof
IgniteClientDisconnectedCheckedException) {
LOG.warn("Client disconnected from cluster. 
Waiting for reconnect...");
IgniteClientDisconnectedCheckedException cause =
(IgniteClientDisconnectedCheckedException)e.getCause();
cause.reconnectFuture().get(); // Wait for 
reconnect.
}else{
throw e;
}
}
[...]



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Ignite-Jdbc-connection-tp8431p8441.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Ignite Jdbc connection

2016-10-24 Thread Manu
You are right,  if connection is closed due to cluster *client* node
disconnection, client will automatically recreate connection using discovery
configuration. Pool is also supported, but N pooled instances of
org.apache.ignite.internal.jdbc2.JdbcConnection for same url on same java VM
will use same and unique ignite instance...



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Ignite-Jdbc-connection-tp8431p8440.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Ignite Jdbc connection

2016-10-24 Thread Anil
typo correction.

Thanks Manu.
>
> if i understand it correctly, if connection is closed due to cluster node
> failure, client will automatically recreate connection using discovery
> configuration.
>
> and *jdbc connection does support connection pool*.
>
> thanks for your help.
>
>
>
>
>
> On 24 October 2016 at 18:12, Manu  wrote:
>
>> Hi,
>>
>> as you know, org.apache.ignite.internal.jdbc2.JdbcConnection is an
>> implementation of java.sql.Connection, works always on client mode (this
>> flag is hardcoded to true when load xml configuration passed on connection
>> url) and works on read mode (only select). On same java VM instance,
>> connection (ignite instance) is cached internally in JdbcConnection by
>> url,
>> so for same connection (type, path, collocation...) you only have (and
>> need)
>> one ignite instance. For more info check this
>> https://apacheignite.readme.io/docs/jdbc-driver
>> 
>>
>> As a java.sql.Connection, you could use a javax.sql.DataSource
>> implementation to manage it and checks connection status (validation
>> query)
>> etc, but you don't need a pool, for example:
>>
>> > destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
>> > value="org.apache.ignite.IgniteJdbcDriver"/>
>> > value="jdbc:ignite:cfg://cache=default:collocated=true:local=false@ignite
>> /data_grid/ignite-client.xml"/>
>> 
>> 
>> > value="300"/>
>> 
>> 
>>
>>
>> [...]
>> This is client ignite configuration with default cache (dummy, without
>> data,
>> only used to validate client connection) used on url of
>> collocatedDbcpIgniteDataGridDataSource
>>
>> > class="org.apache.ignite.configuration.IgniteConfiguration">
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> > value="default*" />
>> > value="PARTITIONED" />
>> 
>> 
>>
>> java.lang.String
>>
>> java.lang.String
>> 
>> 
>> 
>> [...]
>>
>>
>>
>> --
>> View this message in context: http://apache-ignite-users.705
>> 18.x6.nabble.com/Ignite-Jdbc-connection-tp8431p8436.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>
>


How to continuously subscribe for event?

2016-10-24 Thread suhuadong
hi,team

My cache subscribe the EVT_CACHE_OBJECT_EXPIRED,I want the event trigger
every a minute.
But,I find that the event only trigger once.

My code:

   IgnitePredicate rmtLsnr = new Task();
   
Ignition.ignite().events(Ignition.ignite().cluster().forCacheNodes("myCache")).remoteListen(null,rmtLsnr,
EventType.EVT_CACHE_OBJECT_EXPIRED);



static class Task implements  IgnitePredicate,Serializable {
private static final long serialVersionUID = 6529685098267757690L;

@Override
public boolean apply(CacheEvent evt) {
System.out.println(oldVal.getClass());
Ignition.ignite().cache("myCache").put(dvId,oldVal);
  }





--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-continuously-subscribe-for-event-tp8438.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Ignite Jdbc connection

2016-10-24 Thread Anil
Thanks Manu.

if i understand it correctly, if connection is closed due to cluster node
failure, client will automatically recreate connection using discovery
configuration.

and jdbc connection does not support connection pool.

thanks for your help.





On 24 October 2016 at 18:12, Manu  wrote:

> Hi,
>
> as you know, org.apache.ignite.internal.jdbc2.JdbcConnection is an
> implementation of java.sql.Connection, works always on client mode (this
> flag is hardcoded to true when load xml configuration passed on connection
> url) and works on read mode (only select). On same java VM instance,
> connection (ignite instance) is cached internally in JdbcConnection by url,
> so for same connection (type, path, collocation...) you only have (and
> need)
> one ignite instance. For more info check this
> https://apacheignite.readme.io/docs/jdbc-driver
> 
>
> As a java.sql.Connection, you could use a javax.sql.DataSource
> implementation to manage it and checks connection status (validation query)
> etc, but you don't need a pool, for example:
>
>  destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
>  value="org.apache.ignite.IgniteJdbcDriver"/>
>  value="jdbc:ignite:cfg://cache=default:collocated=true:local=false@ignite
> /data_grid/ignite-client.xml"/>
> 
> 
>  value="300"/>
> 
> 
>
>
> [...]
> This is client ignite configuration with default cache (dummy, without
> data,
> only used to validate client connection) used on url of
> collocatedDbcpIgniteDataGridDataSource
>
>  class="org.apache.ignite.configuration.IgniteConfiguration">
> 
> 
> 
> 
> 
> 
> 
>  value="default*" />
>  value="PARTITIONED" />
> 
> 
>
> java.lang.String
>
> java.lang.String
> 
> 
> 
> [...]
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Ignite-Jdbc-connection-tp8431p8436.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Re: Ignite Jdbc connection

2016-10-24 Thread Manu
Hi,

as you know, org.apache.ignite.internal.jdbc2.JdbcConnection is an
implementation of java.sql.Connection, works always on client mode (this
flag is hardcoded to true when load xml configuration passed on connection
url) and works on read mode (only select). On same java VM instance,
connection (ignite instance) is cached internally in JdbcConnection by url,
so for same connection (type, path, collocation...) you only have (and need)
one ignite instance. For more info check this 
https://apacheignite.readme.io/docs/jdbc-driver
  

As a java.sql.Connection, you could use a javax.sql.DataSource
implementation to manage it and checks connection status (validation query)
etc, but you don't need a pool, for example:








 


[...]
This is client ignite configuration with default cache (dummy, without data,
only used to validate client connection) used on url of
collocatedDbcpIgniteDataGridDataSource





 



default*" />




java.lang.String

java.lang.String 

 


[...]



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Ignite-Jdbc-connection-tp8431p8436.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Why doesn't the index be used in my test?

2016-10-24 Thread Vladislav Pyatkov
Hi Bob,

If you put annotation on fields then need to use
"CacheConfiguration.setIndexedTypes". But for Query Entity, you must
discribe entiti in configuration (QueryEntity.setIndexes) without
annotation.

Please, look  at [1]

If it doesn't help, provide your query configuration.

[1]: https://apacheignite.readme.io/docs/sql-queries

On Mon, Oct 24, 2016 at 10:47 AM, 胡永亮/Bob  wrote:

> Hi everyone,
>
> I have a model Kc21, akc273 is its one String column .
>
> I create the index in this column, as the following:
> @QuerySqlField(index = true)
> private String akc273;
>
> Then I load data into cache from oracle, total 47535542 rows.
>
> I execute the sql query to get the execute plan:
>
>
>
> *SqlFieldsQuery sql = new SqlFieldsQuery(
>   "explain select BKC231 from Kc21 where akc273 = '王妍'"); logger.info
> ("execute plan:"+cache.query(sql).getAll());*
>
> The result is:
> *execute plan:[[SELECT*
>
>
>
>
>
>
>
> *BKC231 AS __C0FROM "Kc21Cache".KC21/* "Kc21Cache".KC21.__SCAN_ 
> */WHERE AKC273 = STRINGDECODE('\u738b\u598d')], [SELECT__C0 AS BKC231FROM 
> PUBLIC.__T0/* "Kc21Cache"."merge_scan" */]]
> *
>
> I think this tell me that the index is not used in this sql. Why?
> And the query time also very long as the time before creating this
> index.
>
> Thank your reply. ^V^
>
> Bob
>
> 
> ---
> Confidentiality Notice: The information contained in this e-mail and any
> accompanying attachment(s)
> is intended only for the use of the intended recipient and may be
> confidential and/or privileged of
> Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader
> of this communication is
> not the intended recipient, unauthorized use, forwarding, printing,
> storing, disclosure or copying
> is strictly prohibited, and may be unlawful.If you have received this
> communication in error,please
> immediately notify the sender by return e-mail, and delete the original
> message and all copies from
> your system. Thank you.
> 
> ---
>



-- 
Vladislav Pyatkov


Why doesn't the index be used in my test?

2016-10-24 Thread 胡永亮/Bob
Hi everyone,

I have a model Kc21, akc273 is its one String column .

I create the index in this column, as the following:
@QuerySqlField(index = true)
private String akc273;

Then I load data into cache from oracle, total 47535542 rows.

I execute the sql query to get the execute plan: 
SqlFieldsQuery sql = new SqlFieldsQuery(
  "explain select BKC231 from Kc21 where akc273 = '王妍'");
logger.info("execute plan:"+cache.query(sql).getAll());

The result is:
execute plan:[[SELECT
BKC231 AS __C0
FROM "Kc21Cache".KC21
/* "Kc21Cache".KC21.__SCAN_ */
WHERE AKC273 = STRINGDECODE('\u738b\u598d')], [SELECT
__C0 AS BKC231
FROM PUBLIC.__T0
/* "Kc21Cache"."merge_scan" */]]

I think this tell me that the index is not used in this sql. Why?
And the query time also very long as the time before creating this index. 

Thank your reply. ^V^

Bob


---
Confidentiality Notice: The information contained in this e-mail and any 
accompanying attachment(s)
is intended only for the use of the intended recipient and may be confidential 
and/or privileged of
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of 
this communication is
not the intended recipient, unauthorized use, forwarding, printing,  storing, 
disclosure or copying
is strictly prohibited, and may be unlawful.If you have received this 
communication in error,please
immediately notify the sender by return e-mail, and delete the original message 
and all copies from
your system. Thank you.
---


Kafka Streamer

2016-10-24 Thread Anil
Hi,

I am playing with kafka streamer for my use case and noticed that message
has to value of the ignite cache.

getStreamer().addData(msg.key(), msg.message());

(
https://github.com/apache/ignite/blob/master/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java
)

i tried with stream receiver to covert incoming kafka message to number of
cache entries and did not help. Seems like stream receiver is not
pre-process of cache entry. Correct ?

To allow client to add its own way of processing, Kafka streamer must
provide a way to transform kafka message into cache entries. what do you
say ?

code would be like below (just giving a try with sudo code)

kafkaStreamer.registerTransformer()

if (null !=transformer){
getStreamer().addData(transformer.transform(msg.message()));
}else {
getStreamer().addData(msg.key(), msg.message());
}

Thanks for your help.