Re: [EXTERNAL] Re: Exception while trying to access cache via JDBC API

2016-11-01 Thread Chetan . V . Yadav
I have attached gradle file along with my config xml.

On 11/1/16, 11:05 PM, "Sergej Sidorov"  wrote:

Hi chevy!

I suppose that the issue in your configuration. Could you please provide
your pom.xml and mpm-ignite.xml?

Thanks,
Sergej



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Exception-while-trying-to-access-cache-via-JDBC-API-tp8648p8651.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.






build.gradle
Description: build.gradle


mpm-ignite.xml
Description: mpm-ignite.xml


mpm-default.xml
Description: mpm-default.xml


Re: [EXTERNAL] Re: class org.apache.ignite.IgniteCheckedException: Failed to register query type: TypeDescriptor

2016-09-06 Thread Chetan . V . Yadav
Hi,

 I changed the variable to “todayData" from “today” in SalesModel but still 
getting same error.


/** TdyFeedModel: todayData (not-indexed). */

@QuerySqlField

public TdyFeedModel todayData;

--
Regards,
Chetan.

From: Sergi Vladykin >
Reply-To: "user@ignite.apache.org" 
>
Date: Tuesday, September 6, 2016 at 5:18 PM
To: "user@ignite.apache.org" 
>
Subject: [EXTERNAL] Re: class org.apache.ignite.IgniteCheckedException: Failed 
to register query type: TypeDescriptor

Hi!

The name `TODAY` is problematic because there is a function with the same name.

Sergi

2016-09-06 12:40 GMT+03:00 chevy 
>:
Hi,

 I am getting "Caused by: org.h2.jdbc.JdbcSQLException: Syntax error in SQL
statement "CREATE TABLE ""salesCache"".SALESMODEL (_KEY INT NOT NULL,_VAL
OTHER,ID VARCHAR,STOREID INT,DATE VARCHAR,GOAL DOUBLE,FORECAST
DOUBLE,HOURLYSALES OTHER,SALESDATE VARCHAR,TODAY[*] OTHER,TYSALES
DOUBLE,LYSALES DOUBLE,TYTRANSACTIONCOUNT DOUBLE,LYTRANSACTIONCOUNT
DOUBLE,TYAVERAGEBASKETSIZE DOUBLE,LYAVERAGEBASKETSIZE DOUBLE,PREVIOUSDAY
OTHER,WEEKTODATE OTHER,MONTHTODATE OTHER) ENGINE "
"org.apache.ignite.internal.processors.query.h2.opt.GridH2Table$Engine"" ";
expected "identifier"; SQL statement:
CREATE TABLE "salesCache".SalesModel (_key INT NOT NULL,_val OTHER,id
VARCHAR,storeId INT,date VARCHAR,goal DOUBLE,forecast DOUBLE,hourlySales
OTHER,salesDate VARCHAR,today OTHER,tySales DOUBLE,lySales
DOUBLE,tyTransactionCount DOUBLE,lyTransactionCount
DOUBLE,tyAverageBasketSize DOUBLE,lyAverageBasketSize DOUBLE,previousDay
OTHER,weekToDate OTHER,monthToDate OTHER) engine
"org.apache.ignite.internal.processors.query.h2.opt.GridH2Table$Engine"
error.

I have attached complete log in this post. I am not able to understand how
my data is affecting creating of cache schema and table.

I am adding data to cache in below format -

"cache.putAll(finalMap)" and cache is of format "IgniteCache cache". "finalMap" looks like "finalMap.put(storeId,
salesModel)". SalesModel structure is shown below -

package com.ignite.model.sales;

import java.io.Serializable;
import java.sql.Date;

import org.apache.ignite.cache.query.annotations.QuerySqlField;

public class SalesModel implements Serializable {

private static final long serialVersionUID = 1L;

/** SalesModel: id (not-indexed). */
@QuerySqlField
public String id;

/** SalesModel: storeId (not-indexed). */
@QuerySqlField
public int storeId;

/** SalesModel: date (not-indexed). */
@QuerySqlField
public String date;

/** TdyFeedModel: tdy (not-indexed). */
@QuerySqlField
public TdyFeedModel day;

/** YstFeedModel: yst (not-indexed). */
@QuerySqlField
public WtdFeedModel previousDay;

/** WtdFeedModel: wtd (not-indexed). */
@QuerySqlField
public WtdFeedModel weekToDate;

/** MtdFeedModel: mtd (not-indexed). */
@QuerySqlField
public MtdFeedModel monthToDate;

//setters and getters for all variables
}

Cache config is as shown below -
/* Initialize cache configuration */
cacheCfg.setName("salesCache");
cacheCfg.setCacheMode(CacheMode.REPLICATED);
cacheCfg.setSwapEnabled(false);
cacheCfg.setOffHeapMaxMemory(0);
cacheCfg.setCopyOnRead(false);

cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);

cacheCfg.setAtomicWriteOrderMode(CacheAtomicWriteOrderMode.CLOCK);
cacheCfg.setIndexedTypes(Integer.class, 
SalesModel.class);

/* Start Ignite node. */
String path = "src/main/java/com/ignite/config/";
Ignite ignite = Ignition.start(path + "mpm-ignite.xml");

try (IgniteCache cache =
ignite.getOrCreateCache(cacheCfg)) {
if 
(ignite.cluster().forDataNodes(cache.getName()).nodes().isEmpty()) {
...
}

// Put created data entries to cache.
cache.putAll(finalMap);

log.txt 



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/class-org-apache-ignite-IgniteCheckedException-Failed-to-register-query-type-TypeDescriptor-tp7543.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.



Re: Start node in remote server which needs authentication

2016-08-05 Thread Chetan . V . Yadav
That is the issue I am facing. I am not able to load my key in pem file to jks 
as it expects certificate along with it. Anyway I can get this working?
--
Regards,
Chetan.

From: Vladislav Pyatkov >
Reply-To: "user@ignite.apache.org" 
>
Date: Friday, August 5, 2016 at 4:28 PM
To: "user@ignite.apache.org" 
>
Subject: Re: Start node in remote server which needs authentication

1) If your configuration is not contains IgniteConfiguration (not abstract) 
then ignite start will fail.

2) You must to put the key into JKS. I recommend use JAVA_HMOE/bin/keytool for 
creation JKS and generate key.
The links keyStoreFilePath, trustStoreFilePath must point to jks.

On Fri, Aug 5, 2016 at 1:35 PM, chevy 
> wrote:
Let me add more clarity on current issue -


  1.  I have a question - How does (abstract=true) affect this config?
  2.  I want to connect node running in my local with the one running in my 
remote machine but the connection is secure. When I tried to create keystore 
file (to be used with SslContextFactory) using .pem file it was failing as 
there was no certificate available for it. pem file just contains auth details 
and no certs. So, can I use just .pem file to get connected to remote (like I 
do in terminal using command "ssh -i ~/.ssh/goku.pem ubuntu@ipAddress”) through 
my Java code?

--
Regards,
Chetan.

From: "vdpyatkov [via Apache Ignite Users]" <[hidden 
email]>
Date: Friday, August 5, 2016 at 3:03 PM
To: "Chetan.V.Yadav" <[hidden 
email]>
Subject: Re: Start node in remote server which needs authentication

Are you sure, which start Ignite with the configuration. The configuration 
contains only abstract Spring bean (abstract="true").

Please provide full configuration and log file (How are you start node in 
terminal? What are you seen in command line?).

About this:
Is this the right way to get nodes attached to cluster? If, yes I am not able 
to get that remote machine identified due to firewall issue. I use .pem file to 
ssh into that remote machine so it expects to be authenticated. How can I 
implement this process and get the remote node attached to the one I am running 
in my local?

Yea it is correct configuration IpFinder.
How do you relate discoverySPI with .pem file? You can use ssh for start 
remoute node only (or you can do it any other way on other machine). After 
nodes have been started, they will joining to cluster using discoverySPI[1] 
(over ports 7500..47509), further they will useing communicationSPI[2] for data 
processing.

If you want all data stream between nodes will by secure, you can use 
SslContextFactory [3]

[1] 
http://apacheignite.readme.io/v1.6/docs/cluster-config#static-ip-based-discovery
[2] 
http:/apacheignite.readme.io/docs/network-config#tcpcommunicationspi
[3] http://apacheignite.readme.io/docs/ssltls

On Fri, Aug 5, 2016 at 9:30 AM, chevy <[hidden 
email]> wrote:
I have started node in my remote machine using below config -