public MapKeyLoader(String mapName, OperationService opService, IPartitionService ps, ClusterService clusterService, ExecutionService execService, IFunction<Object, Data> serialize) { this.mapName = mapName; this.opService = opService; this.partitionService = ps; this.clusterService = clusterService; this.toData = serialize; this.execService = execService; this.logger = getLogger(MapKeyLoader.class); }
public AbstractChannel(SocketChannel socketChannel, boolean clientMode) { this.socketChannel = socketChannel; this.clientMode = clientMode; this.logger = Logger.getLogger(getClass()); }
public AbstractChannel(SocketChannel socketChannel, boolean clientMode) { this.socketChannel = socketChannel; this.clientMode = clientMode; this.logger = Logger.getLogger(getClass()); }
private static void warnIfDuplicate(Class<NodeExtension> klass) { if (!klass.equals(DefaultNodeExtension.class) && klass.getName().equals(DefaultNodeExtension.class.getName())) { Logger.getLogger(NodeExtensionFactory.class).warning( "DefaultNodeExtension class has been loaded by two different class-loaders.\n" + "Classloader 1: " + NodeExtensionFactory.class.getClassLoader() + '\n' + "Classloader 2: " + klass.getClassLoader() + '\n' + "Are you running Hazelcast Jet in an OSGi environment?" + " If so, set the bundle class-loader in the Config using the setClassloader() method"); } } }
private static void warnIfDuplicate(Class<NodeExtension> klass) { if (!klass.equals(DefaultNodeExtension.class) && klass.getName().equals(DefaultNodeExtension.class.getName())) { Logger.getLogger(NodeExtensionFactory.class).warning( "DefaultNodeExtension class has been loaded by two different class-loaders.\n" + "Classloader 1: " + NodeExtensionFactory.class.getClassLoader() + '\n' + "Classloader 2: " + klass.getClassLoader() + '\n' + "Are you running Hazelcast Jet in an OSGi environment?" + " If so, set the bundle class-loader in the Config using the setClassloader() method"); } } }
public static int getFactoryId(String prop, int defaultId) { final String value = System.getProperty(prop); if (value != null) { try { return Integer.parseInt(value); } catch (NumberFormatException e) { Logger.getLogger(FactoryIdHelper.class).finest("Parameter for property prop could not be parsed", e); } } return defaultId; } }
static Integer getReferenceSizeOrNull() { Integer referenceSize = null; try { long firstFieldOffset = UNSAFE.objectFieldOffset(ReferenceSizeEstimator.class.getField("firstField")); long secondFieldOffset = UNSAFE.objectFieldOffset(ReferenceSizeEstimator.class.getField("secondField")); referenceSize = (int) abs(secondFieldOffset - firstFieldOffset); } catch (Exception e) { getLogger(JVMUtil.class).fine("Could not determine cost of reference using field offsets: " + e.getMessage()); } return referenceSize; } }
@Nonnull @Override public ILogger logger() { if (logger == null) { logger = Logger.getLogger(loggerName()); } return logger; }
protected final ILogger getLogger() { final NodeEngine ne = nodeEngine; return ne != null ? ne.getLogger(getClass()) : Logger.getLogger(getClass()); }
public Hibernate4CacheEntrySerializerHook() { Class<?> cacheEntryClass = null; if (UnsafeHelper.UNSAFE_AVAILABLE) { try { cacheEntryClass = Class.forName("org.hibernate.cache.spi.entry.CacheEntry"); } catch (Exception e) { Logger.getLogger(Hibernate4CacheEntrySerializerHook.class).finest(SKIP_INIT_MSG); } } this.cacheEntryClass = cacheEntryClass; }
public final ILogger getLogger() { final String name = getClass().getName(); try { return instance.getLoggingService().getLogger(name); } catch (UnsupportedOperationException e) { // HazelcastInstance is instance of HazelcastClient. return Logger.getLogger(name); } } }
public static int getLockTimeoutInMillis(final Properties props) { int timeout = -1; try { timeout = ConfigurationHelper.getInt(LOCK_TIMEOUT, props, -1); } catch (Exception e) { Logger.getLogger(CacheEnvironment.class).finest(e); } if (timeout < 0) { timeout = MAXIMUM_LOCK_TIMEOUT; } return timeout; }
public static int getLockTimeoutInMillis(final Properties props) { int timeout = -1; try { timeout = ConfigurationHelper.getInt(LOCK_TIMEOUT, props, -1); } catch (Exception e) { Logger.getLogger(CacheEnvironment.class).finest(e); } if (timeout < 0) { timeout = MAXIMUM_LOCK_TIMEOUT; } return timeout; }
@Override public void evict(final Object key) throws CacheException { try { getCache().remove(key); } catch (OperationTimeoutException e) { Logger.getLogger(AbstractGeneralRegion.class).finest(e); } }
public void evictAll() throws CacheException { try { getCache().clear(); } catch (OperationTimeoutException e) { Logger.getLogger(AbstractGeneralRegion.class).finest(e); } }
@Override public void evict(final Object key) throws CacheException { try { getCache().remove(key); } catch (OperationTimeoutException e) { Logger.getLogger(AbstractGeneralRegion.class).finest(e); } }
@Override public void evictAll() throws CacheException { try { getCache().clear(); } catch (OperationTimeoutException e) { Logger.getLogger(AbstractGeneralRegion.class).finest(e); } }
@Override public void put(final SharedSessionContractImplementor session, final Object key, final Object value) throws CacheException { try { getCache().put(key, value, nextTimestamp(), null); } catch (OperationTimeoutException e) { Logger.getLogger(AbstractGeneralRegion.class).finest(e); } }
@Override public void put(final SessionImplementor session, final Object key, final Object value) throws CacheException { try { getCache().put(key, value, nextTimestamp(), null); } catch (OperationTimeoutException e) { Logger.getLogger(AbstractGeneralRegion.class).finest(e); } }
@Override public void put(final SessionImplementor session, final Object key, final Object value) throws CacheException { try { getCache().put(key, value, nextTimestamp(), null); } catch (OperationTimeoutException e) { Logger.getLogger(AbstractGeneralRegion.class).finest(e); } }