내 membase 서버에 연결하기 위해 aspymemcached 클라이언트를 사용하고있었습니다. 코드 모양처럼 :membase 서버와 couchbase 서버 마이그레이션 : Java 클라이언트
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, "");
}
캐시에 객체를 넣는 경우 : 캐시에서 점점 개체에 대해
public static void makeMembaseCacheEntry(final String key, final int expiryTime, final Object value, final String bucketName) {
MemcachedClient client = getMembaseClient(bucketName);
if (client != null) {
client.set(key, expiryTime, value);
}
:
public static Object getMembaseCacheEntry(String key) {
Object value = null;
try {
MemcachedClient client = getMembaseClient(bucketName);
if (client != null) {
value = client.get(key);
}
} catch (Exception e) {
}
return value;
}
지금은 따라서, 서버 카우치베이스 주식회사하는 membase 서버를 업그레이드 할 계획 couchbase 클라이언트 자바 API (Ref : http://docs.couchbase.com/developer/java-2.1/java-intro.html)를 사용해야합니다. cousebase 클라이언트에서 모든 작업이 된 JSONObject 심판 수행 : 그래서
http://docs.couchbase.com/developer/java-2.0/documents-basics.html
가 어떻게 당신이 저장하는 것은 직렬화 Object
경우 클라이언트에게
주의를, 최신 자바 클라이언트 2.4입니다 최신 문서는 https://developer.couchbase.com/documentation/server/4.6/sdk/java/start-using-sdk.html입니다 (이전 버전과 두 가지 버전의 서로 다른 문서에 링크되어 있습니다) –