IDEMPIERE-4764 Hazelcast distributed cache can be an issue in some environments (#655)

* IDEMPIERE-4764 Hazelcast distributed cache can be an issue in some environments

- Change setting for all caches to be non-distributed

* IDEMPIERE-4764 Hazelcast distributed cache can be an issue in some environments

* TC-324 Fix cache related monitoring and performance issues

- PO & GridTable call to CacheMgt reset should be async.

Co-authored-by: hengsin <hengsin@gmail.com>
This commit is contained in:
Carlos Ruiz 2021-04-19 14:41:34 +02:00 committed by GitHub
parent 4de94e3d21
commit 8f31506ac7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 13 additions and 13 deletions

View File

@ -2159,7 +2159,7 @@ public class GridTable extends AbstractTableModel
return SAVE_ERROR;
}
CacheMgt.get().reset(m_tableName);
Adempiere.getThreadPoolExecutor().submit(() -> CacheMgt.get().reset(m_tableName));
// everything ok
m_rowData = null;

View File

@ -181,9 +181,9 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport
} // getClientAcctSchema
/** Cache of Client AcctSchema Arrays **/
private static CCache<Integer,MAcctSchema[]> s_schema = new CCache<Integer,MAcctSchema[]>(I_AD_ClientInfo.Table_Name, I_AD_ClientInfo.Table_Name+"|MAcctSchema[]", 3, 120, true); // 3 clients
private static CCache<Integer,MAcctSchema[]> s_schema = new CCache<Integer,MAcctSchema[]>(I_AD_ClientInfo.Table_Name, I_AD_ClientInfo.Table_Name+"|MAcctSchema[]", 3, 120, false); // 3 clients
/** Cache of AcctSchemas **/
private static ImmutableIntPOCache<Integer,MAcctSchema> s_cache = new ImmutableIntPOCache<Integer,MAcctSchema>(Table_Name, 3, 120, true); // 3 accounting schemas
private static ImmutableIntPOCache<Integer,MAcctSchema> s_cache = new ImmutableIntPOCache<Integer,MAcctSchema>(Table_Name, 3, 120); // 3 accounting schemas
/**************************************************************************

View File

@ -135,7 +135,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport
@SuppressWarnings("unused")
private static CLogger s_log = CLogger.getCLogger (MClient.class);
/** Cache */
private static ImmutableIntPOCache<Integer,MClient> s_cache = new ImmutableIntPOCache<Integer,MClient>(Table_Name, 3, 120, true);
private static ImmutableIntPOCache<Integer,MClient> s_cache = new ImmutableIntPOCache<Integer,MClient>(Table_Name, 3, 120);
/**************************************************************************

View File

@ -238,7 +238,7 @@ public class MSysConfig extends X_AD_SysConfig
/** Static Logger */
private static CLogger s_log = CLogger.getCLogger (MSysConfig.class);
/** Cache */
private static CCache<String, String> s_cache = new CCache<String, String>(Table_Name, 40, 0, true);
private static CCache<String, String> s_cache = new CCache<String, String>(Table_Name, 40, 0);
/**
* Get system configuration property of type string

View File

@ -83,7 +83,7 @@ public class MSystem extends X_AD_System
} // get
/** System - cached */
private static CCache<Integer,MSystem> s_system = new CCache<Integer,MSystem>(Table_Name, 1, -1, true);
private static CCache<Integer,MSystem> s_system = new CCache<Integer,MSystem>(Table_Name, 1, -1);
/**************************************************************************
* Default Constructor

View File

@ -2456,10 +2456,10 @@ public abstract class PO
m_createNew = false;
}
if (!newRecord) {
CacheMgt.get().reset(p_info.getTableName(), get_ID());
Adempiere.getThreadPoolExecutor().submit(() -> CacheMgt.get().reset(p_info.getTableName()));
MRecentItem.clearLabel(p_info.getAD_Table_ID(), get_ID());
} else if (get_ID() > 0 && success)
CacheMgt.get().newRecord(p_info.getTableName(), get_ID());
Adempiere.getThreadPoolExecutor().submit(() -> CacheMgt.get().newRecord(p_info.getTableName(), get_ID()));
return success;
} // saveFinish
@ -3640,7 +3640,7 @@ public abstract class PO
int size = p_info.getColumnCount();
m_oldValues = new Object[size];
m_newValues = new Object[size];
CacheMgt.get().reset(p_info.getTableName(), Record_ID);
Adempiere.getThreadPoolExecutor().submit(() -> CacheMgt.get().reset(p_info.getTableName()));
}
}
finally

View File

@ -106,7 +106,7 @@ public class TranslationTable
private static Integer s_activeLanguages = null;
/** Cache */
private static CCache<String,TranslationTable> s_cache = new CCache<String,TranslationTable>(null, "TranslationTable", 20, true);
private static CCache<String,TranslationTable> s_cache = new CCache<String,TranslationTable>(null, "TranslationTable", 20);
/**

View File

@ -85,7 +85,7 @@ public class Scheduler extends AdempiereServer
protected int AD_Scheduler_ID;
private static ImmutableIntPOCache<Integer,MScheduler> s_cache = new ImmutableIntPOCache<Integer,MScheduler>(MScheduler.Table_Name, 10, 60, true);
private static ImmutableIntPOCache<Integer,MScheduler> s_cache = new ImmutableIntPOCache<Integer,MScheduler>(MScheduler.Table_Name, 10, 60);
/**
* Work

View File

@ -591,7 +591,7 @@ public class WChosenboxListEditor extends WEditor implements ContextMenuListener
private WChosenboxListEditor editor;
protected CCacheListener(String tableName, WChosenboxListEditor editor) {
super(tableName, tableName, 0, true);
super(tableName, tableName+"|CCacheListener", 0, false);
this.editor = editor;
}

View File

@ -949,7 +949,7 @@ ContextMenuListener, IZoomableEditor
private WTableDirEditor editor;
protected CCacheListener(String tableName, WTableDirEditor editor) {
super(tableName, tableName+"|CCacheListener", 0, 0, true);
super(tableName, tableName+"|CCacheListener", 0, 0, false);
this.editor = editor;
}