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 
<[email protected]> 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 <[email protected]> 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




  
<?xml version="1.0" encoding="UTF-8"?>

<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<!--
    Ignite Spring configuration file to startup Ignite cache.

    This file demonstrates how to configure cache using Spring. Provided cache
    will be created on node startup.

    Use this configuration file when running HTTP REST examples (see 'examples/rest' folder).

    When starting a standalone node, you need to execute the following command:
    {IGNITE_HOME}/bin/ignite.{bat|sh} examples/config/example-cache.xml

    When starting Ignite from Java IDE, pass path to this file to Ignition:
    Ignition.start("examples/config/example-cache.xml");
-->
<beans xmlns="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";>
    <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="cacheConfiguration">
            <list>
                <!-- Partitioned cache example configuration (Atomic mode). -->
                <bean class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="atomicityMode" value="ATOMIC"/> 
					 <property name="cacheMode" value="PARTITIONED"/>
                    <property name="backups" value="1"/>
					<property name="statisticsEnabled" value="true" />
                </bean>
            </list>
        </property>
		<property name="clientMode" value="true"/>
        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
        <property name="discoverySpi">
            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">
                    <!--
                        Ignite provides several options for automatic discovery that can be used
                        instead os static IP based discovery. For information on all options refer
                        to our documentation: http://apacheignite.readme.io/docs/cluster-config
                    -->
                    <!-- Uncomment static IP finder to enable static-based discovery of initial nodes. -->
                    <!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">-->
                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
                        <property name="addresses">
                            <list>
                                <!-- In distributed environment, replace with actual host IP address. -->
                                <value>127.0.0.1:47500..47509</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?>

<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<!--
    Ignite Spring configuration file to startup Ignite cache.

    This file demonstrates how to configure cache using Spring. Provided cache
    will be created on node startup.

    Use this configuration file when running HTTP REST examples (see 'examples/rest' folder).

    When starting a standalone node, you need to execute the following command:
    {IGNITE_HOME}/bin/ignite.{bat|sh} examples/config/example-cache.xml

    When starting Ignite from Java IDE, pass path to this file to Ignition:
    Ignition.start("examples/config/example-cache.xml");
-->
<beans xmlns="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";>
    <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="cacheConfiguration">
            <list>
                <!-- Partitioned cache example configuration (Atomic mode). -->
                <bean class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="atomicityMode" value="ATOMIC"/> 
					 <property name="cacheMode" value="PARTITIONED"/>
                    <property name="backups" value="1"/>
					<property name="statisticsEnabled" value="true" />
                </bean>
            </list>
        </property>
        <property name="clientMode" value="false" />

        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
        <property name="discoverySpi">
            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">
                    <!--
                        Ignite provides several options for automatic discovery that can be used
                        instead os static IP based discovery. For information on all options refer
                        to our documentation: http://apacheignite.readme.io/docs/cluster-config
                    -->
                    <!-- Uncomment static IP finder to enable static-based discovery of initial nodes. -->
                    <!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">-->
                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
                        <property name="addresses">
                            <list>
                                <!-- In distributed environment, replace with actual host IP address. -->
                                <value>127.0.0.1:47500..47509</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>

Reply via email to