couchbase

membase server to couchbase server migration : Java client

爱⌒轻易说出口 提交于 2019-12-12 04:45:30
问题 I was using aspymemcached client to connect to my membase server. code look like : public static MemcachedClient MemcachedClient(String bucketName){ URI server1 = new URI("http://192.168.100.111:8091/pools"); URI server2 = new URI("http://127.0.0.1:8091/pools"); ArrayList<URI> serverList = new ArrayList<URI>(); serverList.add(server1); serverList.add(server2); return new MemcachedClient(serverList, bucketName, ""); } For putting object in cache : public static void makeMembaseCacheEntry(final

How to get the revision number of couchbase document?

你离开我真会死。 提交于 2019-12-12 04:03:06
问题 I am using the .NET api for couchbase. Just wanted to know how I can get hold of the revision number for the document? Cheers 回答1: As Jeff mentioned above what you want to do is use the cas value. This value exists in both Couchbase and memcached specifically for updating the same document from different threads. The cas is just a random number that is changed every time a document is updated. Basically what you want to do is obtain the cas by using the get() API. This will return you a the

Couchbase: Could not dispatch request, cancelling instead of retrying

杀马特。学长 韩版系。学妹 提交于 2019-12-12 03:56:55
问题 In the case of running queries asynchronously, client crash with the error: com.couchbase.client.core.RequestCancelledException: Could not dispatch request, canceling instead of retrying. Connection Settings: final CouchbaseEnvironment env = DefaultCouchbaseEnvironment .builder() .queryEndpoints(1) .retryStrategy(FailFastRetryStrategy.INSTANCE) .build(); Async query example: Observable<SiteData> dataList = bucket .async() .query(query) .flatMap(AsyncN1qlQueryResult::rows) .map(row -> new

MappingInstantiationException with a BigInteger field in Spring Data Couchbase

旧巷老猫 提交于 2019-12-12 03:47:36
问题 I have an entity with a field of type java.math.BigInteger public class MyEntity { private String id; private BigInteger max; } I don't have any problem in storing the entity in DB using Spring Data JPA; but when I retrieve the entity, I am getting the following exception org.springframework.data.mapping.model.MappingInstantiationException: Failed to instantiate java.math.BigInteger using constructor NO_CONSTRUCTOR with arguments BigInteger doesn't have a no-argument constructor. Is that a

How to use Couchbase.Lite-PCL in a Xamarin Forms project?

假如想象 提交于 2019-12-12 03:43:45
问题 I see there's a Couchbase.Lite-PCL in nuget which has been published recently. Is this capable of running in the PCL? Anyone knows how to make it work? I couldn't find any documentation on this. 回答1: It is not an official NuGet package, so your milage may vary. It does have the dll's in a portable folder, and the dll's are added fine to a PCL and the project seems to build. Try it it, it might work fine, but don't expect any direct support from the couchbase people. Alternatively you could

Two Phase Commit on Couchbase

自古美人都是妖i 提交于 2019-12-12 03:37:32
问题 So I was reading about this two phase commit: http://docs.couchbase.com/couchbase-devguide-2.5/#performing-two-phase-commits AFAIK, Couchbase operation is atomic. Article explains when performing two phase commit I should create a Trans:1 document, which contains the state of the Transaction progress. 1) First is start at Init state. 2) When Transaction start begin process, I should switch Trans:1 's state to pend . By switching to pend state, we can prevent other process pickup the same

Update specific object in the array of object in couchbase 4.1

北城余情 提交于 2019-12-12 02:21:52
问题 I have following doc with doc key cart::16 { "_type": "NSCart", "_metadata": { "created_at": 1473075845614, "updated_at": null }, "_id": "f28bc609-6aba-47e5-8e83-5bee2397566f", "userId": "B1HvmsLj57c9235c", "items" : [{ "itemId": "N1d55j8m4xr", "seller": "ByD9T4Ks57cbbd8e", "license": null, "basePrice": 0 },{ "itemId": "L9nd6Dswl4v", "seller": "ByD9T4Ks57cbbd8e", "license": E122, "basePrice": 500, "eCharge": 10, "total": 510 }] } now i want to update a doc where item id is N1d55j8m4xr like

How can I do paging and sorting using spring data with Couchbase

房东的猫 提交于 2019-12-12 01:24:17
问题 I am trying to do paging and sorting using spring-data-couchbase but it seems org.springframework.data.couchbase.repository has only CouchbaseRepository which is extending CrudRepository<T,ID> . There is no interface extending from PagingAndSortingRepository<T,ID> . http://docs.spring.io/spring-data/couchbase/docs/1.0.x/api/org/springframework/data/couchbase/repository/CouchbaseRepository.html I did implement an unconventional solution to the problem setting skip and limit. But want to get

Unable to get Enyim.Caching MemcachedClient to work with Couchbase

不问归期 提交于 2019-12-11 19:27:51
问题 I realize that Couchbase provides a client to their memcached server, but I'm trying to get the enyim.caching client to work. Here's my trivial c# code that uses the Couchbase client (which works) and then pretty much the same thing with the enyim MemcachedClient: class Program { static void Main(string[] args) { var client = new CouchbaseClient(); client.Store(StoreMode.Set, "somekey", "somevalue"); var somevalue = client.Get<string>("somekey"); Console.WriteLine(somevalue); Console.ReadLine

Pointers on improving Couchbase configuration

懵懂的女人 提交于 2019-12-11 18:27:33
问题 My current configuration is shown below, connecting to a 3 node cluster which are hosted on VM’s. var clientConfiguration = new ClientConfiguration { Servers = new List<Uri> { new Uri("http://10.20.49.31:8091/pools"), new Uri("http://10.20.49.32:8091/pools"), new Uri("http://10.20.49.33:8091/pools"), }, UseSsl = false, DefaultOperationLifespan = 2000, BucketConfigs = new Dictionary<string, BucketConfiguration> { { "Features", new BucketConfiguration BucketName = "Features", UseSsl = false,