git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-publishing/document-store-lib-couchbase@128918 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ccbd722709
commit
1571c06111
|
@ -80,8 +80,8 @@ public class PersistenceCouchBase extends PersistenceBackend {
|
|||
protected Bucket bucketTask;
|
||||
protected String bucketNameTask;
|
||||
|
||||
/*For test */
|
||||
protected Bucket bucket;
|
||||
/*DISABLE */
|
||||
//protected Bucket bucket;
|
||||
|
||||
|
||||
private Map <String, Bucket> connectionMap;
|
||||
|
@ -110,24 +110,35 @@ public class PersistenceCouchBase extends PersistenceBackend {
|
|||
|
||||
connectionMap = new HashMap<String, Bucket>();
|
||||
|
||||
|
||||
|
||||
|
||||
bucketStorage = cluster.openBucket(bucketNameStorage, password);
|
||||
connectionMap.put(BUCKET_STORAGE_TYPE, bucketStorage);
|
||||
|
||||
logger.trace("open bucket: {} with {}",bucketNameStorage,BUCKET_STORAGE_TYPE);
|
||||
|
||||
|
||||
bucketService = cluster.openBucket(bucketNameService, password);
|
||||
connectionMap.put(BUCKET_SERVICE_TYPE, bucketService);
|
||||
|
||||
logger.trace("open bucket: {} with {}",bucketNameService,BUCKET_SERVICE_TYPE);
|
||||
|
||||
|
||||
bucketJob= cluster.openBucket(bucketNameJob, password);
|
||||
connectionMap.put(BUCKET_JOB_TYPE, bucketJob);
|
||||
logger.trace("open bucket: {} with {}",bucketNameJob,BUCKET_JOB_TYPE);
|
||||
|
||||
bucketPortlet= cluster.openBucket(bucketNamePortlet, password);
|
||||
connectionMap.put(BUCKET_PORTLET_TYPE, bucketPortlet);
|
||||
logger.trace("open bucket: {} with {}",bucketNamePortlet,BUCKET_PORTLET_TYPE);
|
||||
|
||||
bucketTask= cluster.openBucket(bucketNameTask, password);
|
||||
connectionMap.put(BUCKET_TASK_TYPE, bucketTask);
|
||||
logger.trace("open bucket: {} with {}",bucketNameTask,BUCKET_TASK_TYPE);
|
||||
|
||||
/*DISABLE
|
||||
bucket = cluster.openBucket(
|
||||
configuration.getProperty(BUCKET_NAME_PROPERTY_KEY), password);
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -136,8 +147,7 @@ public class PersistenceCouchBase extends PersistenceBackend {
|
|||
protected JsonDocument createItem(JsonObject jsonObject, String id,String recordType) throws Exception {
|
||||
JsonDocument doc = JsonDocument.create(id, jsonObject);
|
||||
|
||||
logger.trace("record type:{}",recordType);
|
||||
|
||||
logger.trace("record type:{} accounting on:{}",recordType,connectionMap.get(recordType).toString());
|
||||
|
||||
return connectionMap.get(recordType).upsert(doc);
|
||||
//return bucket.upsert(doc);
|
||||
|
|
Reference in New Issue