ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vijayendra bhati <veejayend...@yahoo.com>
Subject Re: How to exit from Client JVM while using Apache Ignite as Data Grid ?
Date Tue, 05 Apr 2016 07:00:10 GMT
Thanks Vladislav,
I have 1 node running as server with   <property name="clientMode" value="false" />
and I am connecting from my java application with   <property name="clientMode" value="true"
/>.

I am attaching both the configuration files with this mail.
Code snippet is :
public class MarketDataCacheStore { public MarketDataCacheStore(){ //Ignition.setClientMode(true);
mktDataCacheCfg.setBackups(1); mktDataCacheCfg.setCacheMode(CacheMode.PARTITIONED); mktDataCacheCfg.setIndexedTypes(MarketDataKey.class,MarketData.class);
mktDataCache = Ignition.start("config/risk-analytics-cache-client.xml").getOrCreateCache(mktDataCacheCfg);
 }  private static final String PARTITIONED_CACHE_NAME = MarketDataCacheStore.class.getSimpleName()
+ "Partitioned"; private CacheConfiguration<MarketDataKey, MarketData> mktDataCacheCfg
= new CacheConfiguration<>(PARTITIONED_CACHE_NAME); private IgniteCache<MarketDataKey,
MarketData> mktDataCache = null; //private static MarketDataCacheStore cacheStore = new
MarketDataCacheStore(); /*public static MarketDataCacheStore getInstance() { return cacheStore;
}*/ public void putMktDataInCache(HashMap<MarketDataKey,MarketData> marketDataMap){
mktDataCache.putAll(marketDataMap); //Ignition.kill(false); } public void putMktDataInCache(MarketDataKey
marketDataKey,MarketData marketData){ mktDataCache.put(marketDataKey,marketData); }  public
Double[] getMktData(String symbol,Date startDate,Date endDate) { String sql = "symbol = ?
and businessDate between ? and ? order by businessDate";    System.out.println("MarketData
for symbol :"+symbol+" with COB between "+startDate.toString()+ "and "+endDate.toString()
+"queried with SQL query): ");  Double [] mktDataForPeriod =  mktDataCache.query(new SqlQuery<MarketDataKey,
MarketData>(MarketData.class, sql).                 setArgs(symbol, startDate,endDate)).getAll().stream().map(obj->
{                  MarketData mktData = obj.getValue();                  return
mktData.getEodPrice();                 }).toArray(Double[]::new);    System.out.println("Size
returned "+mktDataForPeriod.length);   return mktDataForPeriod;   }
}

Regards,Vij

 

    On Tuesday, April 5, 2016 12:07 PM, Vladislav Pyatkov <vpyatkov@gridgain.com> wrote:
 

 Hi vijayendra,
I think you run one client node (<property name="clientMode" value="true"/>)  wihout
at last one server node. In that case client node be waiting for server node until it (server
node) will not by added.When you start another node in server mode (<property name="clientMode"
value="false"/>), client will continue to work.
If it not help you, please provide additional information.Please, show code, which starts
our node and configuration xml.
On Tue, Apr 5, 2016 at 8:20 AM, vijayendra bhati <veejayendraa@yahoo.com> wrote:

Hi,
I am trying to query over a 1 node Apache Ignite Data grid.But my client program is not getting
exiting, it keeps on running.
Please let me know what needs to be done.I am running the client program in client mode.

Regards,Vij




  
Mime
View raw message