Quantcast
Channel: VMware Communities : Unanswered Discussions - vFabric GemFire [ARCHIVED]
Viewing all 532 articles
Browse latest View live

Functions and caching

$
0
0

I'm a little confused about how caches work with functions...

 

Setup is spring-gemfire so forgive me if I mix terms in the example.

 

I have a replicated region on a server.

I'm running a client region.

 

I have a function registered on the server that deletes a record as part of a transaction (@Transactional, using the spring-gemfire Txmgr).

That all works fine. I can see the logs, the transaction is doing what it should.

 

What drove me nuts yesterday was when I tried to test this.

I wrote a unit test that looked a little like this - excuse the pseudocode and the template. If I use region instead I get the same behaviour.

 

Obj = template.get(key);<function>.delete(key);
Obj1 = template.get(key); <== expected to be null
template.put(key, obj);

 

Initially the client region was set up with shortcut="CACHING_PROXY" and Obj1 was never null.

I thought perhaps this was a timing thing (eventually consistent and all that) and tried adding waits after the function executed. Still the same.

Tx comitted well before the second get.

 

When I set it up to be "PROXY" instead I got the behaviour I expected.

 

I'm reaching a bit, but it appears based on this test that a client region isn't updated when the server region is.

Is this expected behaviour? Is the cache in CACHING_ truly ~just~ a cache with no data aware behaviour?

 

 

 


HTTP Session Management for Tomcat: ServerConnectivityException

$
0
0

Hi everyone,

 

I'm trying to get the HTTP session management module up and running in a client-server configuration with Tomcat 7.  I've modified the server.xml and context.xml files as directed, and I've added a <pool> element to cache-client.xml indicating the host and port of the locator I need to use.  But when I try to run my web app, I get an exception:

 

SEVERE: Error manager.start()

org.apache.catalina.LifecycleException: Failed to start component [Tomcat7DeltaSessionManager[container=StandardEngine[Catalina].StandardHost[localhost].StandardContext[]; regionName=gemfire_modules_sessions; regionAttributesId=null]]

          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)

          at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5300)

          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

          at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)

          at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)

          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

          at java.util.concurrent.FutureTask.run(FutureTask.java:166)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

          at java.lang.Thread.run(Thread.java:722)

Caused by: com.gemstone.gemfire.cache.client.ServerConnectivityException: Could not create a new connection to server 10.0.2.15:40404

          at com.gemstone.gemfire.cache.client.internal.pooling.ConnectionManagerImpl.borrowConnection(ConnectionManagerImpl.java:335)

          at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.executeOnServer(OpExecutorImpl.java:328)

          at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.executeOn(OpExecutorImpl.java:303)

          at com.gemstone.gemfire.cache.client.internal.PoolImpl.executeOn(PoolImpl.java:659)

          at com.gemstone.gemfire.cache.client.internal.SingleHopOperationCallable.call(SingleHopOperationCallable.java:45)

          ... 5 more

I've verified that the server.xml, context.xml, and cache-client.xml files are all being read, but I must be doing something wrong still.  40404 is the default port GemFire uses, so I must have missed a step somewhere, right?
Any advice anyone can offer -- including maybe some more detailed instructions than what's available in the documentation -- would be greatly appreciated. 
Thanks very much in advance!
-Will

GemFire - Hibernate 2L Cache Provider

$
0
0

Hi,

 

I try to use GemFire as Hibernate Second Level Cache Provider. After i deploy my application to JBoss, the following exception is thrown. This issue does not occur with Coherence on JBoss. Do you have any comment?

 

Caused by: com.gemstone.gemfire.management.ManagementException: javax.management.NotCompliantMBeanException: Class does not expose a management interface: java.lang.Object
    at com.gemstone.gemfire.management.internal.MBeanJMXAdapter.registerMBean(MBeanJMXAdapter.java:111)
    at com.gemstone.gemfire.management.internal.SystemManagementService.registerInternalMBean(SystemManagementService.java:384)
    at com.gemstone.gemfire.management.internal.beans.ManagementAdapter.handleCacheCreation(ManagementAdapter.java:162)
    at com.gemstone.gemfire.management.internal.beans.ManagementListener.handleEvent(ManagementListener.java:105)
    at com.gemstone.gemfire.distributed.internal.InternalDistributedSystem.notifyResourceEventListeners(InternalDistributedSystem.java:2087)
    at com.gemstone.gemfire.distributed.internal.InternalDistributedSystem.handleResourceEvent(InternalDistributedSystem.java:424)
    at com.gemstone.gemfire.internal.cache.GemFireCacheImpl.init(GemFireCacheImpl.java:819)
    at com.gemstone.gemfire.internal.cache.GemFireCacheImpl.create(GemFireCacheImpl.java:609)
    at com.gemstone.gemfire.cache.CacheFactory.create(CacheFactory.java:182)
    at com.gemstone.gemfire.cache.CacheFactory.create(CacheFactory.java:227)
    at com.gemstone.gemfire.modules.hibernate.internal.RegionFactoryDelegate.startCache(RegionFactoryDelegate.java:48)
    at com.gemstone.gemfire.modules.hibernate.GemFireRegionFactory.start(GemFireRegionFactory.java:90)
    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:238)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872)
    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
    at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:188)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
    ... 131 more

 

My Installation is

 

Hibernate 3.6.4

jboss-5.1.0.GA
gemfire-7.0
gemfire-modules-2.1.2

 

Thanks...

Copy to clipboard in DataBrowser

$
0
0

There doesn't appear to be a way to copy field or row data to the clipboard in the DataBrowser. Is this planned for future a release?

DataBrowser on Mac OSX 10.8.2

$
0
0

Hello,

 

This post is in regard to difficulty configuring GF's DataBrowser on Mac OSX 10.8.2.  The grid is comprised of two cache servers that have been started using gfsh.  The problem described occurs identically whether connecting through a locator or directly through JMX.

 

When trying to connect to GemFire from the DataBrowser a "RegionMBean Not Found In Distributed System" exception is thrown (full stack trace is below).  The exception is thrown immediately which I take to mean it is getting connected (not timing out) and finding that this gemfire.jar provided class is missing.

 

Since the databrowser script provides the gemfire.jar for the DataBrowser and gfsh provides it to the members started through its facilities, I am at a bit of a loss as to why it is not found? 

 

Any help is greatly appreciated.

 

-Alan

 

Stack trace:

 

[ SEVERE 2013/03/02 13:03:28.407 MST main ] An error occurred when attempting to connect to the GemFire Distributed System com.gemstone.gemfire.mgmt.DataBrowser.connection.ConnectionFailureException: java.lang.Exception: RegionMBean Not Found In Distributed System, isRetryAllowed : false

at com.gemstone.gemfire.mgmt.DataBrowser.connection.internal.JMXDiscoveryImpl.establishConnectionUsingJMXManager(JMXDiscoveryImpl.java:601)

at com.gemstone.gemfire.mgmt.DataBrowser.connection.internal.JMXDiscoveryImpl.<init>(JMXDiscoveryImpl.java:112)

at com.gemstone.gemfire.mgmt.DataBrowser.connection.ConnectionFactory.createGemFireConnection(ConnectionFactory.java:33)

at com.gemstone.gemfire.mgmt.DataBrowser.connection.internal.JMXCallExecutor$1.run(JMXCallExecutor.java:69)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

at java.util.concurrent.FutureTask.run(FutureTask.java:166)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:722)

Caused by: java.lang.Exception: RegionMBean Not Found In Distributed System

at com.gemstone.gemfire.management.internal.beans.DistributedSystemBridge.fetchRegionObjectName(DistributedSystemBridge.java:1022)

at com.gemstone.gemfire.management.internal.beans.DistributedSystemMBean.fetchRegionObjectName(DistributedSystemMBean.java:276)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:601)

at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:192)

at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:174)

at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:117)

at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:54)

at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:235)

at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)

at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:250)

at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)

at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)

at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1486)

at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:96)

at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1327)

at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1419)

at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:847)

at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:601)

at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)

at sun.rmi.transport.Transport$1.run(Transport.java:177)

at sun.rmi.transport.Transport$1.run(Transport.java:174)

at java.security.AccessController.doPrivileged(Native Method)

at sun.rmi.transport.Transport.serviceCall(Transport.java:173)

at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)

FunctionStatistics - functionExecutionsCompletedProcessingTime

$
0
0

We are evaluating the time it takes for some of the requests to complete and wanted to understand what "FunctionStatistics - functionExecutionsCompletedProcessingTime" stat reports. For this stat, I see Nanoseconds/seconds as the value on y-axis. What does it mean? Is there a way to track time taken to complete a particular request?

JTA and Hibernate integration

$
0
0

Hi

 

I am checking if it is possible to integrate Hibernate's JTA TransactionFactory to lookup/follow GemFire's transaction manager as JTA provider.

 

I am trying to execute a set of operations as described below as a part of function execution.

I want myregion.put &  factory.getCurrentSession().update(...) to be part of same underlying JTA Transaction that is started by using GemFire as JTA Provider

try{
    Context ctx = Cache.getJNDIContext();
    UserTransaction tx = (UserTransaction)ctx.lookup("java:/UserTransaction");
                                tx.begin();    // Do some work    factory.getCurrentSession().update(...);    myregion.put(...);    tx.commit();}catch (RuntimeException e) {    tx.rollback();    throw e; // or display error message}

more details can be found here under Transaction Demarcation with JTA : https://community.jboss.org/wiki/SessionsAndTransactions

 

After tx.commit();, I do not see hibernate applying changes to database.

 

I have provided system property as below, as it is suggested in another thread, after which Hibernate is able to locate transaction in JNDI

 

System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.gemstone.gemfire.internal.jndi.InitialContextFactoryImpl");

 

This is GemFire 6.6.3 and Hibernate has its own database connection pool.

There are no JNDI bindings declared in cache.xml

 

I had to add a GemFireTransactionManagerLookup class as below to be provided in hibernate's hibernate.transaction.manager_lookup_class element

 

 

import org.hibernate.HibernateException;

import org.hibernate.transaction.TransactionManagerLookup;

 

import javax.transaction.Transaction;

import javax.transaction.TransactionManager;

import java.util.Properties;

 

public class CGemFireTransactionManagerLookup implements TransactionManagerLookup {

     @Override

     public TransactionManager getTransactionManager(Properties properties) throws HibernateException {

          return com.gemstone.gemfire.internal.jta.TransactionManagerImpl.getTransactionManager();

     }

     @Override

     public String getUserTransactionName() {

          return "java:/UserTransaction";

     }

     @Override

     public Object getTransactionIdentifier(Transaction transaction) {

          return transaction;

     }

}

hibernate cfg settings

 

  <property name="jta.UserTransaction">java:/UserTransaction</property>

  <property name="hibernate.current_session_context_class">jta</property>

  <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>

  <property name="hibernate.transaction.manager_lookup_class">CGemFireTransactionManagerLookup</property>

 

Am I missing something here?

 

thanks

AccessControlException when running gemfire upgrade-disk-store

$
0
0
Hi,

We saw this warning in GF logs when trying to upgrade the disk store from 6.6.x to GF7.0.0.2:
java.security.AccessControlException: access denied (javax.management.MBeanTrustPermission register)        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)        at java.lang.SecurityManager.checkPermission(SecurityManager.java:568)        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1824)        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:310)        at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)        at com.gemstone.gemfire.management.internal.MBeanJMXAdapter.registerMBean(MBeanJMXAdapter.java:103)        at com.gemstone.gemfire.management.internal.SystemManagementService.registerInternalMBean(SystemManagementService.java:384)        at com.gemstone.gemfire.management.internal.beans.ManagementAdapter.handleCacheCreation(ManagementAdapter.java:162)        at com.gemstone.gemfire.management.internal.beans.ManagementListener.handleEvent(ManagementListener.java:105)        at com.gemstone.gemfire.distributed.internal.InternalDistributedSystem.notifyResourceEventListeners(InternalDistributedSystem.java:2087)        at com.gemstone.gemfire.distributed.internal.InternalDistributedSystem.handleResourceEvent(InternalDistributedSystem.java:424)        at com.gemstone.gemfire.internal.cache.GemFireCacheImpl.init(GemFireCacheImpl.java:819)        at com.gemstone.gemfire.internal.cache.GemFireCacheImpl.create(GemFireCacheImpl.java:609)        at com.gemstone.gemfire.cache.CacheFactory.create(CacheFactory.java:182)        at com.gemstone.gemfire.cache.CacheFactory.create(CacheFactory.java:161)        at com.gemstone.gemfire.internal.cache.DiskStoreImpl.createForOffline(DiskStoreImpl.java:5013)        at com.gemstone.gemfire.internal.cache.DiskStoreImpl.offlineCompact(DiskStoreImpl.java:5100)        at com.gemstone.gemfire.internal.SystemAdmin.upgradeDiskStore(SystemAdmin.java:442)        at com.gemstone.gemfire.internal.SystemAdmin.invoke(SystemAdmin.java:2139)        at com.gemstone.gemfire.internal.SystemAdmin.main(SystemAdmin.java:1960)

 

No other errors/warnings seen in logs and the disk store is not upgraded as the peer startup confirms:

java.lang.IllegalStateException: This disk store is still at version GFE pre-7.0.        at com.gemstone.gemfire.internal.cache.DiskStoreImpl.loadFiles(DiskStoreImpl.java:2121)

I'm not sure if disk store upgrade fails because of this or not.
Are we supposed to mock around with security policy? Is this known issue?

 

Thanks


ClientCacheFactory.set("name", clientName) in .net native client

$
0
0

Hi,

 

I ported my Java client over to .net, but could not figure out how to set the name. This is how I do it in Java:

 

new ClientCacheFactory().set("name", clientName)

On the GemFire server side, I can then get the name e.g. by means of:

public void memberJoined(BridgeMembershipEvent event)
{     String clientName = event.getMember().getName();

In C#, I tried to do

CacheFactory.CreateCacheFactory().Set("name", clientName)

which does not throw an error (like it does when I use some made-up property key), but it will not set the client name either.

The name of a .net client will default to "default_GemfireDS".

Is there a way to set the name in .net?

.net native client crashes

$
0
0

I did some benchmarking of a GemFire based prototype and encounters 2  distinct crashes that happen once or twice in 100 tests, each test  executing GemFire functions 100k and putting and removing messages also roughly 100k times each.

 

In this prototype, there are "producer" clients, which  do the GemFire HA function executions sometimes crash just showing the  "your app crashed" dialog (don't know what the message on an English OS  would be exactly) and leaving a .dmp file.

 

There are also "consumer" clients, which do the  Region.puts and Region.removes. They do crash with a similar frequency,  but in addition to the .dmp file, they also leave a stack trace. Here  the original, untranslated message:

 

ハンドルされていない例外: System.AccessViolationException: 保護されているメモリに読み取りまたは書き込み操作を行おうとしました。他のメモリが壊れていることが考えられます。
場所 GemStone.GemFire.Cache.Generic.Region`2.Put(TKey key, TValue value,Object callbackArg)
場 所  ProtoClient.QueueCacheListener.<>c__DisplayClass1.<AfterCreate>b__0(Objectstate)  場所 C:\GemFire7\ProtoClient\ProtoClient\Consumer.cs:行 205
場所  System.Threading.ExecutionContext.Run(ExecutionContextexecutionContext,  ContextCallback callback, Object state, Boolean ignoreSyncCtx)
場所 System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
場所 System.Threading.ThreadPoolWorkQueue.Dispatch()
場所 System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
[error 2013/03/07 18:17:48.946658 東京 (標準時) MACHINE23:436 1952] Debug
event STATUS_ACCESS_VIOLATION occurred at 000007FEF27A182E in process
with pid 436

 

gemfire::ThinClientRegion::invalidateInterestList
gemfire::ThinClientRegion::invalidateInterestList
gemfire::ThinClientRegion::invalidateInterestList
UnhandledExceptionFilter
MD5Final
_C_specific_handler
RtlDecodePointer
RtlUnwindEx
KiUserExceptionDispatcher
gemfire::ThinClientRegion::invalidateInterestList
[error 2013/03/07 18:17:49.290423 東京 (標準時) MACHINE23:436 1952]
Generating debug dump in file
C:\Users\eugen/gemfire_nativeclient-1362647869-436.dmp

 

Both of the above errors occured in Native Client 7.0.0. I downloaded the brand new 7.0.1 and could at least reproduce the "producer" client crash, the one that does not log a stack trace. Not sure if the "consumer" side crash is fixed (as some other AccessViolationException has been fixed with 7.0.1), as it takes a lot of repetitions to reproduce.

 

Any ideas what this could be? Are the common mistakes that make the .net client crash? Is this a bug in the native client?

 

I attached the following dump files:

 

* gemfire_nativeclient-1363144610-1312.dmp (7.0.1 producer client dump)

* PR2-gemfire_nativeclient-1362994391-3044.dmp (7.0.0 producer client dump)

* CO1-gemfire_nativeclient-1362994382-2960.dmp (7.0.0 consumer client dump)

* CO1-gemfire_nativeclient-1362994468-1364.dmp (7.0.0 consumer client dump)

Handle database updates

$
0
0

Hi all

 

I am using Oracle 11g as the backend daatabse. I wanted to cache an entire table  in gemfire .There is a read only application which will in turn read from the cache and will be completely sheilded from the databse.

 

Now the real issue is there are legacy applications which change i.e update the tables in the databse.These application at present cannot interact with cache.Now the databse will have an updated table while the preloaded table in gemfire have stale records.

 

Can anyone suggest how gemfire can handle such db updates. The whole focus is to next get only those updated delta records an d updayting our gemfire cache intead of loading the entire table again.

 

Any help will be highly appreciated.

 

Thanks

Error querying region objects in DataBrowser

$
0
0

I'm querying region objects that have fields of type List<String>. I can successsfully perform the following query:

 

select * from /myRegion m where m.Name='objectName'

 

 

However, when I execute this query:

 

select m.someListOfStrings from /myRegion m where m.Name='objectName'

 

 

I get this result:

Screen Shot 2013-03-13 at 5.41.48 PM.png

 

What is the problem here?

Thanks!

Tom

CacheLoader triggerring create operation in gateway listener

$
0
0

I have a region configured with both a gateway listener and a cache loader

 

 

<gateway-hub id="testHub" port="-1" startup-policy="none">
       <gateway id="testHub">
         <gateway-listener>
           <class-name>com.demo.WriteBehindListener</class-name>
         </gateway-listener>   
         <gateway-queue batch-size="50" batch-time-interval="10000"/>       
       </gateway>
    </gateway-hub>    

 

    <region name="testRegion"> 
        <region-attributes enable-gateway="true" hub-id="testHub">
        <cache-loader>
              <class-name>com.demo.Loader</class-name>
        </cache-loader>
                <eviction-attributes>
                        <lru-memory-size maximum="100"/>
                </eviction-attributes>
        </region-attributes>
  </region>

 

I have noticed that when the cache loader gets called for a cache miss, this eventually causes a CREATE operation to be delivered to the gateway listener as the entry is placed into the cache.

 

However i have noticed that the operation is always set to Create and not LOCAL_LOAD, as a result i am ending up with duplicate entries in my database as i have the following simple logic to handle the operation:

 

          if (operation.isCreate()) {                              
                    genericDAO.save(entity);
                }
            }
            else if(operation.isDestroy()) {
                    genericDAO.delete(entity);
                }
            }
            else if(operation.isUpdate()) {               
                    genericDAO.save(entity);
                }
            }

 

In the GatewayEventListener how do you distinguish between an entry placed into a region that has resulted from a cache load ?

 

operation.isLoad() // always returns false

operation.isLocalLoad() // always returns false

 

Am i missing some configuration in the gateway or region ?

Error when querying with Class Object implementing DataSerializable [Java]

$
0
0

Hi

 

I am working on helper methods using Java for reading and writing non-primitive data (a class object which implements DataSerializable.) to a region via a cacheserver. The following error was encounter when the class object is put into the region.

 

Caused by: java.lang.NoSuchMethodException: testing.TestDataObj.<init>()
        at java.lang.Class.getConstructor0(Unknown Source)
        at java.lang.Class.getConstructor(Unknown Source)
        at com.gemstone.gemfire.internal.InternalDataSerializer.readDataSerializable(InternalDataSerializer.java:2402)


Below is the class object

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import com.gemstone.gemfire.DataSerializable;
import com.gemstone.gemfire.DataSerializer;

 

public class TestDataObj implements DataSerializable {


private int id;
private String testData;

public TestDataObj(int index, String content ){
  this.id = index;   
  this.testData = content;
}

public int getId(){
  return this.id;
}

public String getTestData(){
     return testData; 
}

public void setTestData(String text){
  this.testData = text;
}

@Override
public void fromData(DataInput in) throws IOException, ClassNotFoundException {
  this.id = DataSerializer.readInteger(in);
  this.testData = DataSerializer.readString(in);
 
}

@Override
public void toData(DataOutput out) throws IOException {
  DataSerializer.writeInteger(this.id, out);
  DataSerializer.writeString(this.testData, out);

}

public String toString() {
  String arr = "Data Value -> ";
  arr = arr + "ID = " + this.id + " Content = " + this.testData;
  return arr;
}

}

 

Are the above DataSerializer methods implemented correctly?
What could be the cause of the problem above?

Fixed memory regions producing inconsistent eviction results

$
0
0

hi,

 

I have the following code that creates a local region that holds byte arrays:

 

ClientCacheFactory clientCacheFactory = new ClientCacheFactory(cacheProperties);
            clientCacheFactory.addPoolLocator(locatorAddress, locatorPort);
            clientCacheFactory.setPoolSubscriptionEnabled(true);

            clientCacheFactory.setPoolSubscriptionRedundancy(1);           
            ClientCache clientCache = clientCacheFactory.create(); 

 

EvictionAttributes evictionAttributes =
            EvictionAttributes.createLRUMemoryAttributes(250, ObjectSizer.REFLECTION_SIZE,
                    EvictionAction.LOCAL_DESTROY);
       
        ClientRegionFactory<Collection<Long>, byte[]> clientRegionFactory =

               clientCache.<String, byte[]>createClientRegionFactory(ClientRegionShortcut.LOCAL);

 

        clientRegionFactory.setEvictionAttributes(evictionAttributes);
       
        Region<Collection<Long>, byte[]> region = null;
        try
        {
            region = clientRegionFactory.create("r1Local");
        }catch(RegionExistsException re){
            region = re.getRegion();
        }

 

 

I am using the client cache factory because my application uses other PROXY regions in client server mode.

 

I have a load test that gradually loads data into the region at a reasonably slow pace. I have configured the JVM with the following options:


"-Xms450m -Xmx450m -XX:PermSize=150m -XX:MaxPermSize=150m -XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=20"

 

When a full garbage collection occurs i have noticed that heap drops down to approximately 10% usage, what has happing to all my data in the region ?

I was expecting the heap to be approximately 50% full as the region should hold onto its 250MB of data. As i am using byte arrays i am expecting for the eviction to be very accurate.

 

If i remove all client server functionality and just use local regions in my application created using the CacheFactory, instead of ClientRegionFactory i do not get this weird behaviour.

 

I have experienced a similar problem with eviction when using LRU heap based eviction using a threshold with a resource manager.

 

It looks like the behaviour is totally different as soon as you switch to client server mode.

 

Am i missing something here?


GC pauses and peers timeout

$
0
0

Hi,

 

What are the settings that we can change to take into the account GC pauses? For example, GC takes 45 seconds, but peers disconnect after 35 seconds. We have the following settings set currently:

ack-wait-threshold="30"

member-timeout="20000"

ack-severe-alert-threshold="5"

 

I though we have changed the first two settings that would affect this. For example, if we want GF to declare network split only after 1 minute, what are the correct settings? Maybe it's because we didn't change these settings on locators as well, only on peers?

 

Example log for the case:

 

[warning 2012/10/10 09:18:32.228 EDT server-1-a <ServerConnection on port 40011 Thread 712977> tid=0x378074] 30 seconds have elapsed while waiting for replies: <StateFlushOperation$StateFlushReplyProcessor 4010627 targeting 10.x(29617)<v26>:41604/50136 waiting for 1 replies out of 1  from [10.x(3288)<v27>:5816/48301]> on 10.x(29617)<v26>:41604/50136 whose current membership list is: [[10.x(29617)<v26>:41604/50136, 10.x(3288)<v27>:5816/48301]]

 

[info 2012/10/10 09:18:32.291 EDT server-1-a <UDP ucast receiver> tid=0x27] Received Suspect notification for member(s) [10.x(29617)<v26>:41604] from 10.x(3288)<v27>:5816.  Reason=Failed to respond within ack-wait-threshold

 

[info 2012/10/10 09:18:32.292 EDT server-1-a <UDP ucast receiver> tid=0x27] Received Suspect notification for member(s) [10.x(29617)<v26>:41604] from 10.x(3288)<v27>:5816.

 

[info 2012/10/10 09:18:32.312 EDT server-1-a <ServerConnection on port 40011 Thread 712977> tid=0x378074] wait for replies completed

 

[warning 2012/10/10 09:18:32.339 EDT server-1-a <BridgeMembership Event Invoker> tid=0xe7] Attempting TCP/IP reconnect to  10.31.72.39(3288)<v27>:5816/48301

 

[warning 2012/10/10 09:18:32.356 EDT server-1-a <Pooled High Priority Message Processor 42625> tid=0x378096] Attempting TCP/IP reconnect to  10.x(3288)<v27>:5816/48301

 

[warning 2012/10/10 09:18:32.384 EDT server-1-a <ServerConnection on port 40011 Thread 695944> tid=0x3643dc] Attempting TCP/IP reconnect to  10.x(3288)<v27>:5816/48301

 

[warning 2012/10/10 09:18:32.501 EDT server-1-a <Gateway Event Processor from riddler-hub to riddler-writer> tid=0xd3] Attempting TCP/IP reconnect to  10.x(3288)<v27>:5816/48301

 

[warning 2012/10/10 09:18:32.462 EDT server-1-a <Pooled Waiting Message Processor 27702> tid=0x377f40] Error sending message to 10.x(3288)<v27>:5816/48301 (will reattempt): java.io.IOException: Unable to reconnect to server; possible shutdown:  tcp:///10.x:48301

 

[warning 2012/10/10 09:18:32.462 EDT server-1-a <Pooled Waiting Message Processor 27704> tid=0x3780fa] Error sending message to 10.x(3288)<v27>:5816/48301 (will reattempt): java.io.IOException: Unable to reconnect to server; possible shutdown:  tcp:///10.x:48301

 

[warning 2012/10/10 09:18:32.461 EDT server-1-a <BridgeMembership Event Invoker> tid=0xe7] Attempting TCP/IP reconnect to  10.x(3288)<v27>:5816/48301

 

[info 2012/10/10 09:18:32.559 EDT server-1-a <CloserThread> tid=0x3780fc] GemFireCache[id = 1891770839; isClosing = true; isShutDownAll = false; closingGatewayHubsByShutdownAll = false; created = Fri Sep 21 21:28:42 EDT 2012; server = false; copyOnRead = false; lockLease = 120; lockTimeout = 60]: Now closing.

 

 

Thanks in advance

Master Slave Feature in Gemfire

$
0
0

Hi,

 

Does Gemfire has a Master Slave Feature?

By this I mean one Server is a Master which distributes the task to the Slaves on other Servers. Slave Servers perform some operations over the server(usig FunctionService) and returns the result back to the Master node.

 

Is there anything such in Gemfire?

Gemfire server start/stop giving nullpointer exception

$
0
0

Hi,

 

We are using gemfire 6.5.1.28 version. While stopping & starting Gemfire server we are getting below exception. This setup was working previously.

Starting Gemfire..

java.lang.NullPointerException
        at com.gemstone.gemfire.internal.cache.CacheServerLauncher.start(CacheServerLauncher.java:449)
        at com.gemstone.gemfire.internal.cache.CacheServerLauncher.main(CacheServerLauncher.java:168)

 

Stopping Gemfire..

java.lang.NullPointerException
        at com.gemstone.gemfire.internal.cache.CacheServerLauncher.stop(CacheServerLauncher.java:715)
        at com.gemstone.gemfire.internal.cache.CacheServerLauncher.main(CacheServerLauncher.java:175)

 

Please revert back if you require more information.

 

Thanks,

Mandar

Help required to resolve "Existing cache's default pool was not compatible."

$
0
0

Hi,

I have following cache.xml, and started cacheserver, and confirmed     that cache server is running.

But when I execute below groovy script to connect to server cache, I     get below exception. Could someone guide me, what is wrong with my     configuration or script?

Regards
Nash

cache.xml

<?xml version="1.0"?>
<!DOCTYPE cache PUBLIC "-//Gemstone Systems Inc.//Gemfire     Declrative Cache 6.5//EN"
             "http://www.gemstone.com/dtd/cache6_5.dtd">
<cache is-server="true" search-timeout="60">
     <cache-server port="40404" max-connections="800" />
     <region name="reglocal" refid="LOCAL">
         <entry>
             <key><string>Key</string></key>
                 <value><string>Key</string></value>
         </entry>
     </region>
     <region name="regrepli" refid="REPLICATE" />
     <region name="part" refid="PARTITION" />
</cache>

-------------------------------------------------------
Groovy script to connect to server cache
-------------------------------------------------------

import com.gemstone.gemfire.cache.client.*;

def cacheClientF = new     ClientCacheFactory().addPoolServer("127.0.0.1",40404);
def clientCache = cacheClientF.create();       
def regionF = clientCache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
def region = regionF.create("regrepli")
region.put("Key1", "Let us test first key1");
region.size()

-------------
Exception
-------------

java.lang.IllegalStateException: Existing cache's default pool was     not compatible
     at com.gemstone.gemfire.internal.cache.GemFireCacheImpl.determineDefaultPool(GemFireCacheImpl.java:2431)
     at com.gemstone.gemfire.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:195)
     at com.gemstone.gemfire.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:162)
     at     com.gemstone.gemfire.cache.client.ClientCacheFactory$create.call(Unknown     Source)
     at ConsoleScript3.run(ConsoleScript3:3)



Why is thread count for multisite gateway process so high

$
0
0

I have 2 data sites with a WAN gateway running at each of the site.

 

<cache>

 

        <gateway-hub id="multisite-gateway" >
                <gateway id="remote-a-gateway" concurrency-level="1">
                        <gateway-endpoint port="11011" host="las-prd-gemgw01.lv1.coupons.lan" id="remote-a-gateway-endpoint-1"/>
                        <gateway-endpoint port="11011" host="las-prd-gemgw02.lv1.coupons.lan" id="remote-a-gateway-endpoint-2"/>
                        <gateway-queue batch-size="1000" batch-time-interval="1000" maximum-queue-memory="100" batch-conflation="true" enable-persistence="true" disk-store-name="gateway-overflow-disk-store"/>
                </gateway>
        </gateway-hub>

 

I noticed that the thread count for the GW process in GFMon tool is around 800s and eventually got an alert with something like

 

 

Rejected connection from Server connection from ... because incoming request was rejected by pool possibly due to thread exhaustion

 

I also noticed that the # of threads is closely related to the number of established TCP connections. Can someone explains how

the threads and TCP connections are managed in the gateway.

 

Thanks.

Viewing all 532 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>