Search in sources :

Example 1 with WeakValueMap

use of org.datanucleus.util.WeakValueMap in project hive by apache.

the class ObjectStore method clearFieldMap.

private static long clearFieldMap(ClassLoaderResolverImpl clri, String mapFieldName) throws Exception {
    Field mapField = ClassLoaderResolverImpl.class.getDeclaredField(mapFieldName);
    mapField.setAccessible(true);
    Map<String, Class> map = (Map<String, Class>) mapField.get(clri);
    long sz = map.size();
    mapField.set(clri, Collections.synchronizedMap(new WeakValueMap()));
    return sz;
}
Also used : Field(java.lang.reflect.Field) WeakValueMap(org.datanucleus.util.WeakValueMap) Map(java.util.Map) WeakValueMap(org.datanucleus.util.WeakValueMap) MRoleMap(org.apache.hadoop.hive.metastore.model.MRoleMap) HashMap(java.util.HashMap)

Aggregations

Field (java.lang.reflect.Field)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 MRoleMap (org.apache.hadoop.hive.metastore.model.MRoleMap)1 WeakValueMap (org.datanucleus.util.WeakValueMap)1