Added log to test on IS
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@120305 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
615dff37df
commit
7f5e0fc426
|
@ -69,6 +69,7 @@ public abstract class AccountingPersistenceBackendFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static FallbackPersistenceBackend createFallback(String scope){
|
protected static FallbackPersistenceBackend createFallback(String scope){
|
||||||
|
logger.debug("Creating {} for scope {}", FallbackPersistenceBackend.class.getSimpleName(), scope);
|
||||||
File fallbackFile = null;
|
File fallbackFile = null;
|
||||||
if(scope!=null){
|
if(scope!=null){
|
||||||
ScopeBean bean = new ScopeBean(scope);
|
ScopeBean bean = new ScopeBean(scope);
|
||||||
|
@ -84,6 +85,8 @@ public abstract class AccountingPersistenceBackendFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static AccountingPersistenceBackend discoverAccountingPersistenceBackend(String scope){
|
protected static AccountingPersistenceBackend discoverAccountingPersistenceBackend(String scope){
|
||||||
|
logger.debug("Discovering {} for scope {}",
|
||||||
|
AccountingPersistenceBackend.class.getSimpleName(), scope);
|
||||||
ServiceLoader<AccountingPersistenceBackend> serviceLoader = ServiceLoader.load(AccountingPersistenceBackend.class);
|
ServiceLoader<AccountingPersistenceBackend> serviceLoader = ServiceLoader.load(AccountingPersistenceBackend.class);
|
||||||
for (AccountingPersistenceBackend foundPersistence : serviceLoader) {
|
for (AccountingPersistenceBackend foundPersistence : serviceLoader) {
|
||||||
try {
|
try {
|
||||||
|
@ -111,7 +114,7 @@ public abstract class AccountingPersistenceBackendFactory {
|
||||||
protected static AccountingPersistenceBackend rediscoverAccountingPersistenceBackend(AccountingPersistenceBackend actual, String scope){
|
protected static AccountingPersistenceBackend rediscoverAccountingPersistenceBackend(AccountingPersistenceBackend actual, String scope){
|
||||||
Long now = Calendar.getInstance().getTimeInMillis();
|
Long now = Calendar.getInstance().getTimeInMillis();
|
||||||
Long lastCheckTimestamp = fallbackLastCheck.get(scope);
|
Long lastCheckTimestamp = fallbackLastCheck.get(scope);
|
||||||
logger.trace("Last check was {}", lastCheckTimestamp);
|
logger.debug("Last check for scope {} was {}", scope, lastCheckTimestamp);
|
||||||
|
|
||||||
if( (lastCheckTimestamp + FALLBACK_RETRY_TIME) <= now ){
|
if( (lastCheckTimestamp + FALLBACK_RETRY_TIME) <= now ){
|
||||||
logger.debug("The {} for scope {} is {}. Is time to rediscover if there is another possibility.",
|
logger.debug("The {} for scope {} is {}. Is time to rediscover if there is another possibility.",
|
||||||
|
@ -178,8 +181,10 @@ public abstract class AccountingPersistenceBackendFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
AccountingPersistenceBackend persistence = null;
|
AccountingPersistenceBackend persistence = null;
|
||||||
|
logger.debug("Going to synchronized block in getPersistenceBackend");
|
||||||
synchronized (accountingPersistenceBackends) {
|
synchronized (accountingPersistenceBackends) {
|
||||||
persistence = accountingPersistenceBackends.get(scope);
|
persistence = accountingPersistenceBackends.get(scope);
|
||||||
|
logger.debug("{} {}", AccountingPersistenceBackend.class.getSimpleName(), persistence);
|
||||||
if(persistence==null){
|
if(persistence==null){
|
||||||
/*
|
/*
|
||||||
* Setting FallbackPersistence and unlocking.
|
* Setting FallbackPersistence and unlocking.
|
||||||
|
|
Loading…
Reference in New Issue