GithubHelp home page GithubHelp logo

Comments (9)

tristantarrant avatar tristantarrant commented on June 3, 2024

https://issues.jboss.org/browse/ISPN-6715 and #15

from infinispan-cachestore-mongodb.

xenthik avatar xenthik commented on June 3, 2024

One thing i am trying to figure out the difference in putAsync and org.infinispan.configuration.cache.AsyncStoreConfiguration, even if it always shows AsyncStoreConfiguration.ENABLED is false. But putAsync is works like write-behind. is there any relationship between putAsync and AsyncStoreConfiguration ?

from infinispan-cachestore-mongodb.

tristantarrant avatar tristantarrant commented on June 3, 2024

cache.putAsync() will asynchronously put the entry into the cache. The following should help you understand:
put() to a persistent write-through cache (i.e. write-behind disabled): writes to both memory and to the cache store before returning
put() to a persistent write-behind cache: writes to memory and returns. Writing to the cache store is performed asynchronously on a separate thread.
putAsync() to a persistent write-through cache (i.e. write-behind disabled): returns immediately. Writes to both memory and to the cache store happen on a single separate thread.
putAsync() to a persistent write-behind cache: returns immediately. Writes to memory and to the cache store is performed asynchronously on two separate threads.

from infinispan-cachestore-mongodb.

xenthik avatar xenthik commented on June 3, 2024

How can i enable(use) write-behind through API ? my configurations looks like following?

AsyncStoreConfiguration asyncStore =
p.addStore(MongoDBStoreConfigurationBuilder.class).ignoreModifications(false)
.purgeOnStartup(false)
.fetchPersistentState(true)
.preload(true)
.connectionURI("mongodb://" + hostname + ":" + port + "/" + DATABASE + "?connectTimeoutMS=1000&w=1")
.collection(COLLECTION)
.create()
.async();
System.out.println(asyncStore.enabled()); // this gives false.
config = b.build();

from infinispan-cachestore-mongodb.

tristantarrant avatar tristantarrant commented on June 3, 2024

See https://github.com/infinispan/infinispan-cachestore-mongodb/blob/master/src/test/java/org/infinispan/persistence/mongodb/configuration/MongoDBStoreConfigurationBuilderTest.java#L28

from infinispan-cachestore-mongodb.

galderz avatar galderz commented on June 3, 2024

This is now fixed, closing.

from infinispan-cachestore-mongodb.

xenthik avatar xenthik commented on June 3, 2024

Configuration conf = builder
.persistence()
.addStore(MongoDBStoreConfigurationBuilder.class)
.connectionURI(CONNECTION_URI)
.collection(COLLECTION)
.async().enable()
.build();

In MongoDBStoreConfigurationBuilderTest.java, follwoing test is getting failed , Why ? assertTrue(conf.persistence().fetchPersistentState());

from infinispan-cachestore-mongodb.

xenthik avatar xenthik commented on June 3, 2024

Even if I have following configurations
<persistence passivation="false"> <mongodbStore xmlns="urn:infinispan:config:store:mongodb:8.2" **_shared="true" preload="true" fetch-state="true" purge="false" singleton="true"_**> <connection uri="mongodb://mongoUser:mongoPass@localhost:27017/infinispan_test_database?w=0&amp;connectTimeoutMS=2000" collection="infinispan_cachestore"/> <write-behind /> </mongodbStore> </persistence>

List stores give the following output against the configuration:
[AbstractStoreConfiguration [attributes=[shared=false, ignoreModifications=false, fetchPersistentState=false, purgeOnStartup=false, preload=false, properties={}], async=AsyncStoreConfiguration [attributes=[enabled=false, modificationQueueSize=1024, threadPoolSize=1]], singletonStore=SingletonStoreConfiguration [attributes=[pushStateWhenCoordinator=true, pushStateTimeout=10000, enabled=false]]]]

from infinispan-cachestore-mongodb.

tristantarrant avatar tristantarrant commented on June 3, 2024

Running mvn clean install from master
Results :
Tests run: 14, Failures: 0, Errors: 0, Skipped: 0

How are you running it ?
I plan to do a release this week.

from infinispan-cachestore-mongodb.

Related Issues (6)

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.