Giter Club home page Giter Club logo

datanucleus-cache's Introduction

datanucleus-cache

DataNucleus support for third-party caching products. This includes memcached, EHCache (not javax.cache), Redis, and Cacheonix. Note that this plugin is for caching products that do NOT implement the javax.cache standardised API. Support for javax.cache API products is included in datanucleus-core.

This is built using Maven, by executing mvn clean install which installs the built jar in your local Maven repository.

KeyFacts

License : Apache 2 licensed
Issue Tracker : http://github.com/datanucleus/datanucleus-cache/issues
Javadocs : 5.1, 5.0, 4.0
Download(Releases) : Maven Central
Download(Nightly) : Nightly Builds
Dependencies : See file pom.xml

datanucleus-cache's People

Contributors

andyjefferson avatar renataogarcia avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

datanucleus-cache's Issues

NPE and HashKey conflict in Xmemcached module

NPE:
Xmemcached code does not pre-handle null id before get CachedPC. this will throw npe like below:

NestedThrowablesStackTrace:
java.lang.NullPointerException
at org.datanucleus.cache.xmemcached.XmemcachedLevel2Cache.getCacheKeyForId (XmemcachedLevel2Cache.java:208)
at org.datanucleus.cache.xmemcached.XmemcachedLevel2Cache.get (XmemcachedLevel2Cache.java:163)
at org.datanucleus.state.AbstractStateManager.updateLevel2CacheForFields (AbstractStateManager.java:992)
at org.datanucleus.state.AbstractStateManager.loadFieldsInFetchPlan (AbstractStateManager.java:1097)
at org.datanucleus.store.fieldmanager.LoadFieldManager.processPersistable (LoadFieldManager.java:68)
at org.datanucleus.store.fieldmanager.LoadFieldManager.internalFetchObjectField (LoadFieldManager.java:113)
at org.datanucleus.store.fieldmanager.AbstractFetchDepthFieldManager.fetchObjectField (AbstractFetchDepthFieldManager.java:114)
at org.datanucleus.state.AbstractStateManager.replacingObjectField (AbstractStateManager.java:1590)
at org.datanucleus.state.StateManagerImpl.replacingObjectField(StateManagerImpl.java:120)
at org.apache.hadoop.hive.metastore.model.MColumnDescriptor.dnReplaceField (MColumnDescriptor.java)
at org.apache.hadoop.hive.metastore.model.MColumnDescriptor.dnReplaceFields (MColumnDescriptor.java)
at org.datanucleus.state.StateManagerImpl.replaceFields(StateManagerImpl.java:3109)
at org.datanucleus.state.StateManagerImpl.replaceFields(StateManagerImpl.java:3136)
at org.datanucleus.state.AbstractStateManager.loadFieldsInFetchPlan (AbstractStateManager.java:1096)

HashKey conflict:

Another problem is that getCacheKeyForId function may cause key conflict because of the use of hashcode function on id.toString(). In my realistic test, there are 10 conflicts in 100000 queries.

L2 cache does not support distributed server

The problem is that the L2 cache using Ehcache plugin with distributed support does not work well (throws nothing found exception).

follow datanucleus/datanucleus-core#260 (comment)

The first app found pc is null and go to initialize a new class:

java.lang.Thread#getStackTrace#1589
org.datanucleus.enhancer.EnhancementHelper#registerClass#349
org.apache.hadoop.hive.metastore.model.MRoleMap##-1
java.lang.Class#forName0#-2
java.lang.Class#forName#274
org.datanucleus.ClassLoaderResolverImpl#ClassOrNullWithInitialize#533
org.datanucleus.ClassLoaderResolverImpl#classForNameWithInitialize#287
org.datanucleus.ClassLoaderResolverImpl#classForName#360
org.datanucleus.state.ObjectProviderFactoryImpl#getInitialisedClassForClass#306
org.datanucleus.state.ObjectProviderFactoryImpl#newForHollow#109
org.datanucleus.ExecutionContextImpl#findObject#3055
org.datanucleus.store.rdbms.query.PersistentClassROF#getObjectForDatastoreId#460
org.datanucleus.store.rdbms.query.PersistentClassROF#getObject#385
org.datanucleus.store.rdbms.query.ForwardQueryResult#nextResultSetElement#181
org.datanucleus.store.rdbms.query.ForwardQueryResult$QueryResultIterator#next#400
org.datanucleus.store.rdbms.query.ForwardQueryResult#processNumberOfResults#143
org.datanucleus.store.rdbms.query.ForwardQueryResult#advanceToEndOfResultSet#164
org.datanucleus.store.rdbms.query.ForwardQueryResult#getSizeUsingMethod#511
org.datanucleus.store.query.AbstractQueryResult#size#357
org.datanucleus.store.query.Query#executeQuery#1863
org.datanucleus.store.query.Query#executeWithArray#1733
org.datanucleus.api.jdo.JDOQuery#executeInternal#365
org.datanucleus.api.jdo.JDOQuery#executeWithArray#264
org.apache.hadoop.hive.metastore.ObjectStore#getMSecurityUserRoleMap#3421
org.apache.hadoop.hive.metastore.ObjectStore#grantRole#3341
sun.reflect.NativeMethodAccessorImpl#invoke0#-2
sun.reflect.NativeMethodAccessorImpl#invoke#57
sun.reflect.DelegatingMethodAccessorImpl#invoke#43
java.lang.reflect.Method#invoke#606
org.apache.hadoop.hive.metastore.RawStoreProxy#invoke#101
com.sun.proxy.$Proxy28#grantRole#-1

The second app found pc from cache and go to get that meta:

throws 'Cannot lookup meta info for MRoleMap - nothing found'
org.datanucleus.enhancer.EnhancementHelper#getMeta#495
org.datanucleus.enhancer.EnhancementHelper#newInstance#147
org.datanucleus.state.StateManagerImpl#initialiseForHollow#248
org.datanucleus.state.StateManagerImpl#initialiseForCachedPC#600
org.datanucleus.state.ObjectProviderFactoryImpl#newForCachedPC#280
org.datanucleus.ExecutionContextImpl#getObjectFromLevel2Cache#5169
org.datanucleus.ExecutionContextImpl#getObjectFromCache#5060
org.datanucleus.ExecutionContextImpl#findObject#3004
org.datanucleus.store.rdbms.query.PersistentClassROF#getObjectForDatastoreId#460
org.datanucleus.store.rdbms.query.PersistentClassROF#getObject#385
org.datanucleus.store.rdbms.query.ForwardQueryResult#nextResultSetElement#181
org.datanucleus.store.rdbms.query.ForwardQueryResult$QueryResultIterator#next#400
org.datanucleus.store.rdbms.query.ForwardQueryResult#processNumberOfResults#143
org.datanucleus.store.rdbms.query.ForwardQueryResult#advanceToEndOfResultSet#164
org.datanucleus.store.rdbms.query.ForwardQueryResult#getSizeUsingMethod#511
org.datanucleus.store.query.AbstractQueryResult#size#357
org.datanucleus.store.query.Query#executeQuery#1863
org.datanucleus.store.query.Query#executeWithArray#1733
org.datanucleus.api.jdo.JDOQuery#executeInternal#365
org.datanucleus.api.jdo.JDOQuery#executeWithArray#264
org.apache.hadoop.hive.metastore.ObjectStore#getMSecurityUserRoleMap#3421
org.apache.hadoop.hive.metastore.ObjectStore#grantRole#3341
sun.reflect.NativeMethodAccessorImpl#invoke0#-2
sun.reflect.NativeMethodAccessorImpl#invoke#57
sun.reflect.DelegatingMethodAccessorImpl#invoke#43
java.lang.reflect.Method#invoke#606
org.apache.hadoop.hive.metastore.RawStoreProxy#invoke#101
com.sun.proxy.$Proxy28#grantRole#-1

I agree with that L2 cache outlives the PMF because of distributed server in the background. I'm not sure this unsupported feature is relative to only Ehcache or not.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.