@Override protected void afterRun() { try { idQ.offer(id); } catch (Throwable ignored) { ignore(ignored); } } }
private static URL asURL(final String path) { try { return new URL(path); } catch (MalformedURLException ignored) { ignore(ignored); } return null; }
private static URL asURL(final String path) { try { return new URL(path); } catch (MalformedURLException ignored) { ignore(ignored); } return null; }
private void sleepInterval(long nowNanos) { try { TimeUnit.NANOSECONDS.sleep(ONE_SECOND_IN_NANOS - (System.nanoTime() - nowNanos)); } catch (Exception ignored) { ignore(ignored); } }
private static URL asFile(final String path) { File file = new File(path); if (file.exists()) { try { return file.toURI().toURL(); } catch (MalformedURLException ignored) { ignore(ignored); } } return null; }
private static void tryShutdown(HazelcastClientInstanceImpl client) { try { client.doShutdown(); } catch (Throwable ignored) { ignore(ignored); } } }
private static <T> T getOrInstantiate(T instance, ClassLoader classLoader, String className) { if (instance != null) { return instance; } try { return ClassLoaderUtil.newInstance(classLoader, className); } catch (Exception ignored) { ignore(ignored); } return null; }
public static LoginModuleUsage get(String v) { try { return LoginModuleUsage.valueOf(v.toUpperCase(StringUtil.LOCALE_INTERNAL)); } catch (Exception ignore) { ignore(ignore); } return REQUIRED; } }
private static void closeSockets(HazelcastInstanceImpl factory) { if (factory.node.connectionManager != null) { try { factory.node.connectionManager.shutdown(); } catch (Throwable ignored) { ignore(ignored); } } }
@Override public void close(EventRegistration eventRegistration) { Registration registration = (Registration) eventRegistration; Object listener = registration.getListener(); if (!(listener instanceof Closeable)) { return; } try { ((Closeable) listener).close(); } catch (IOException e) { ignore(e); } }
private void deregisterLifecycleListener() { LifecycleService lifecycleService = hazelcastInstance.getLifecycleService(); try { lifecycleService.removeLifecycleListener(lifecycleListenerRegistrationId); } catch (HazelcastInstanceNotActiveException e) { // if hazelcastInstance is already terminated, // `lifecycleService.removeLifecycleListener()` will throw a // HazelcastInstanceNotActiveException, which we can safely ignore // (see TerminatedLifecycleService) ignore(e); } }
public void refreshPartitions() { try { // use internal execution service for all partition refresh process (do not use the user executor thread) clientExecutionService.execute(new RefreshTask()); } catch (RejectedExecutionException ignored) { ignore(ignored); } }
@Override protected boolean shouldCancel(boolean mayInterruptIfRunning) { boolean cancelled = false; try { ClientMessage request = MapReduceCancelCodec.encodeRequest(name, jobId); ClientMessage response = invoke(request, jobId); cancelled = MapReduceCancelCodec.decodeResponse(response).response; } catch (Exception ignore) { ignore(ignore); } return cancelled; }
private static void closeSockets(HazelcastClientInstanceImpl client) { ClientConnectionManagerImpl connectionManager = (ClientConnectionManagerImpl) client.getConnectionManager(); if (connectionManager != null) { try { connectionManager.shutdown(); } catch (Throwable ignored) { ignore(ignored); } } }
@Override protected boolean shouldCancel(boolean mayInterruptIfRunning) { boolean cancelled = false; try { ClientMessage request = MapReduceCancelCodec.encodeRequest(name, jobId); ClientMessage response = invoke(request, jobId); cancelled = MapReduceCancelCodec.decodeResponse(response).response; } catch (Exception ignore) { ignore(ignore); } return cancelled; }
@TimeStep(prob = 0.3) public void get(ThreadState state) { try { int key = state.randomInt(keyCount); map.get(key); state.count.getCount.incrementAndGet(); } catch (DistributedObjectDestroyedException e) { EmptyStatement.ignore(e); } }
private void cleanup() { running = false; try { sendOutput.close(); datagramPacketReceive.setData(new byte[0]); datagramPacketSend.setData(new byte[0]); } catch (Throwable ignored) { ignore(ignored); } stopLatch.countDown(); }
@Override public void run() { try { doRun(); } catch (InterruptedException e) { ignore(e); } catch (Throwable t) { inspectOutOfMemoryError(t); logger.severe(t); } }
@Override public void run() { try { doRun(); } catch (InterruptedException e) { ignore(e); } catch (Throwable t) { inspectOutOfMemoryError(t); logger.severe(t); } }
@TimeStep(prob = 0.3) public void putAsyncTTL(ThreadState state) { try { int key = state.randomInt(keyCount); int value = state.randomInt(); int delayMs = minTTLExpiryMs + state.randomInt(maxTTLExpiryMs); map.putAsync(key, value, delayMs, TimeUnit.MILLISECONDS); state.count.putAsyncTTLCount.incrementAndGet(); } catch (DistributedObjectDestroyedException e) { EmptyStatement.ignore(e); } }