@Override public void init(InitializationContext ctx) { this.configuration = ctx.getConfiguration(); this.ctx = ctx; this.scheduler = Schedulers.from(ctx.getExecutor()); this.timeService = ctx.getTimeService(); this.semaphore = new Semaphore(Integer.MAX_VALUE, true); }
@Override public void init(InitializationContext ctx) { factory = ctx.getMarshalledEntryFactory(); timeService = ctx.getTimeService(); }
private void addNewExpiry(MarshalledEntry entry) throws IOException { long expiry = entry.getMetadata().expiryTime(); long maxIdle = entry.getMetadata().maxIdle(); if (maxIdle > 0) { // Coding getExpiryTime() for transient entries has the risk of being a moving target // which could lead to unexpected results, hence, InternalCacheEntry calls are required expiry = maxIdle + ctx.getTimeService().wallClockTime(); } Long at = expiry; Object key = entry.getKey(); try { expiryEntryQueue.put(new ExpiryEntry(at, key)); } catch (InterruptedException e) { Thread.currentThread().interrupt(); // Restore interruption status } }
@Override public void init(InitializationContext ctx) { configuration = ctx.getConfiguration(); marshaller = ctx.getMarshaller(); marshalledEntryFactory = ctx.getMarshalledEntryFactory(); byteBufferFactory = ctx.getByteBufferFactory(); timeService = ctx.getTimeService(); maxKeyLength = configuration.maxNodeSize() - IndexNode.RESERVED_SPACE; }
@Override public void init(InitializationContext ctx) { this.ctx = ctx; this.configuration = ctx.getConfiguration(); this.cache = ctx.getCache(); this.marshaller = ctx.getMarshaller(); this.storeName = makeStoreName(configuration, cache); this.initCount.incrementAndGet(); this.timeService = ctx.getTimeService(); }
Metadata metadata = metadataHelper.buildMetadata(contentType, ttl, TimeUnit.SECONDS, maxidle, TimeUnit.SECONDS); if (metadata.maxIdle() > -1 || metadata.lifespan() > -1) { long now = ctx.getTimeService().wallClockTime(); internalMetadata = new InternalMetadataImpl(metadata, now, now); } else {
@Override public void init(InitializationContext ctx) { this.configuration = ctx.getConfiguration(); this.emfRegistry = ctx.getCache().getAdvancedCache().getComponentRegistry().getGlobalComponentRegistry().getComponent(EntityManagerFactoryRegistry.class); this.marshallerEntryFactory = ctx.getMarshalledEntryFactory(); this.marshaller = ctx.getMarshaller(); this.timeService = ctx.getTimeService(); this.executorService = ctx.getExecutor(); }
List<Object> keys = new ArrayList<>(); long now = ctx.getTimeService().wallClockTime(); RocksIterator iterator = expiredDb.newIterator(new ReadOptions().setFillCache(false)); if (iterator != null) {
@Override public void init(InitializationContext ctx) { this.configuration = ctx.getConfiguration(); this.cacheName = ctx.getCache().getName(); this.globalConfiguration = ctx.getCache().getCacheManager().getCacheManagerConfiguration(); this.marshalledEntryFactory = ctx.getMarshalledEntryFactory(); this.marshaller = ctx.getMarshaller(); this.timeService = ctx.getTimeService(); this.keyPartitioner = configuration.segmented() ? ctx.getKeyPartitioner() : null; this.isDistributedCache = ctx.getCache().getCacheConfiguration() != null && ctx.getCache().getCacheConfiguration().clustering().cacheMode().isDistributed(); }