@DataRehashed public void dataRehashed(DataRehashedEvent<BeanKey<I>, BeanEntry<I>> event) { Locality newLocality = new ConsistentHashLocality(event.getCache(), event.getConsistentHashAtEnd());
@DataRehashed public void dataRehashed(DataRehashedEvent<SessionCreationMetaDataKey, ?> event) { Cache<SessionCreationMetaDataKey, ?> cache = event.getCache(); Locality newLocality = new ConsistentHashLocality(cache, event.getConsistentHashAtEnd()); if (event.isPre()) { Future<?> future = this.rehashFuture.getAndSet(null); if (future != null) { future.cancel(true); } try { this.executor.submit(() -> this.dispatcher.getContext().cancel(newLocality)); } catch (RejectedExecutionException e) { // Executor was shutdown } } else { Locality oldLocality = new ConsistentHashLocality(cache, event.getConsistentHashAtStart()); try { this.rehashFuture.set(this.executor.submit(() -> this.schedule(oldLocality, newLocality))); } catch (RejectedExecutionException e) { // Executor was shutdown } } }
@org.infinispan.notifications.cachelistener.annotation.DataRehashed public void handle(DataRehashedEvent e) { handler.handle(e); } }
@Override @DataRehashed public void fire(DataRehashedEvent<K, V> payload) { super.fire(new CDIDataRehashedEvent(payload)); } }
@Override @DataRehashed public void fire(DataRehashedEvent<K, V> payload) { super.fire(new CDIDataRehashedEvent(payload)); } }
@DataRehashed @SuppressWarnings("unused") public void onDataRehashed(DataRehashedEvent event) { if (event.isPre()) latch.countDown(); } }
@DataRehashed public void onDataRehashed(DataRehashedEvent<Object, Object> e) { log.tracef("New event received: %s", e); events.add(e); }
@DataRehashed public void dataRehashed(DataRehashedEvent<BeanKey<I>, BeanEntry<I>> event) { Locality newLocality = new ConsistentHashLocality(event.getCache(), event.getConsistentHashAtEnd()); if (event.isPre()) { Future<?> future = this.rehashFuture.getAndSet(null); if (future != null) { future.cancel(true); } try { this.executor.submit(() -> { this.scheduler.cancel(newLocality); }); } catch (RejectedExecutionException e) { // Executor was shutdown } } else { Locality oldLocality = new ConsistentHashLocality(event.getCache(), event.getConsistentHashAtStart()); try { this.rehashFuture.set(this.executor.submit(() -> this.schedule(oldLocality, newLocality))); } catch (RejectedExecutionException e) { // Executor was shutdown } } }