Restore bucket storage status

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-publishing/document-store-lib-couchbase@141761 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Alessandro Pieve 2017-01-25 11:52:34 +00:00
parent 8a974b99fd
commit 3b0d99cc52
1 changed files with 14 additions and 19 deletions

View File

@ -44,8 +44,8 @@ public class PersistenceCouchBase extends PersistenceBackend {
public static final String BUCKET_STORAGE_NAME_PROPERTY_KEY="AggregatedStorageUsageRecord";
public static final String BUCKET_STORAGE_TYPE="StorageUsageRecord";
//public static final String BUCKET_STORAGE_STATUS_NAME_PROPERTY_KEY="AggregatedStorageStatusRecord";
//public static final String BUCKET_STORAGE_STATUS_TYPE="StorageStatusRecord";
public static final String BUCKET_STORAGE_STATUS_NAME_PROPERTY_KEY="AggregatedStorageStatusRecord";
public static final String BUCKET_STORAGE_STATUS_TYPE="StorageStatusRecord";
public static final String BUCKET_SERVICE_NAME_PROPERTY_KEY="AggregatedServiceUsageRecord";
public static final String BUCKET_SERVICE_TYPE="ServiceUsageRecord";
@ -89,7 +89,7 @@ public class PersistenceCouchBase extends PersistenceBackend {
bucketNames = new HashMap<>();
bucketNames.put(BUCKET_STORAGE_TYPE, configuration.getProperty(BUCKET_STORAGE_NAME_PROPERTY_KEY));
//bucketNames.put(BUCKET_STORAGE_STATUS_TYPE, configuration.getProperty(BUCKET_STORAGE_STATUS_NAME_PROPERTY_KEY));
bucketNames.put(BUCKET_STORAGE_STATUS_TYPE, configuration.getProperty(BUCKET_STORAGE_STATUS_NAME_PROPERTY_KEY));
bucketNames.put(BUCKET_SERVICE_TYPE, configuration.getProperty(BUCKET_SERVICE_NAME_PROPERTY_KEY));
bucketNames.put(BUCKET_JOB_TYPE, configuration.getProperty(BUCKET_JOB_NAME_PROPERTY_KEY));
bucketNames.put(BUCKET_PORTLET_TYPE, configuration.getProperty(BUCKET_PORTLET_NAME_PROPERTY_KEY));
@ -172,10 +172,17 @@ public class PersistenceCouchBase extends PersistenceBackend {
String recordType=record.getRecordType();
createItem(jsonObject, record.getId(),recordType);
}
/**
* {@inheritDoc}
*/
@Override
protected void disconnect() throws Exception {
public void close() throws Exception {
logger.debug("PersistenceCouchBase close" );
}
@Override
protected void closeAndClean() throws Exception {
synchronized (Connections.connectionsMap) {
for (Map.Entry<String, Bucket> entry : Connections.connectionsMap.get(nodes).getBucketsMap().entrySet())
{
@ -189,23 +196,11 @@ public class PersistenceCouchBase extends PersistenceBackend {
logger.warn("cluster not disconnect");
}
Connections.connectionsMap.remove(nodes);
logger.trace("PersistenceCouchBase disconnect" );
}
};
/**
* {@inheritDoc}
*/
@Override
public void close() throws Exception {
logger.debug("PersistenceCouchBase close" );
//Boolean closed =connections.connectionsMap.get(nodes).getCluster().disconnect();
//cluster.disconnect();
}