private GemFireCacheImpl getGemFireCache() { return getParent().getCache(); }
void decBackgroundTasks() { int v = this.backgroundTasks.decrementAndGet(); // logger.info(LocalizedStrings.DEBUG, "DEBUG: decBackgroundTasks " + v, new // Exception()); if (v == 0) { synchronized (this.backgroundTasks) { this.backgroundTasks.notifyAll(); } } getCache().getCachePerfStats().decDiskTasksWaiting(); }
void decBackgroundTasks() { int v = this.backgroundTasks.decrementAndGet(); if (v == 0) { synchronized (this.backgroundTasks) { this.backgroundTasks.notifyAll(); } } getCache().getCachePerfStats().decDiskTasksWaiting(); }
int incBackgroundTasks() { getCache().getCachePerfStats().incDiskTasksWaiting(); int v = this.backgroundTasks.incrementAndGet(); return v; }
int incBackgroundTasks() { getCache().getCachePerfStats().incDiskTasksWaiting(); int v = this.backgroundTasks.incrementAndGet(); // logger.info(LocalizedStrings.DEBUG, "DEBUG: incBackgroundTasks " + v, new // Exception()); return v; }
/** * Execute a task asynchronously, or in the calling thread if the bound * is reached. This pool is used for write operations which can be delayed, * but we have a limit on how many write operations we delay so that * we don't run out of disk space. Used for deletes, unpreblow, RAF close, etc. */ public boolean executeDelayedExpensiveWrite(Runnable task) { Future<?> f = (Future<?>)executeDiskStoreTask(task, getCache().getDiskDelayedWritePool(), false); lastDelayedWrite = f; return f != null; }
public void forceFlush() { try { flushFlusher(false); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); getCache().getCancelCriterion().checkCancelInProgress(ie); } }
public void forceFlush() { try { flushFlusher(false); } catch (InterruptedException ie) { // logger.info(LocalizedStrings.DEBUG, "DEBUG forceFlush interrupted"); Thread.currentThread().interrupt(); getCache().getCancelCriterion().checkCancelInProgress(ie); } }
/** * Execute a task which must be performed asnychronously, but has no requirement * for timely execution. This task pool is used for compactions, creating KRFS, etc. * So some of the queued tasks may take a while. */ public boolean executeDiskStoreTask(final Runnable runnable) { return executeDiskStoreTask(runnable, getCache().getDiskStoreTaskPool(), true) != null; }
public void run() { try { // now close the cache getCache().close(sid.toLocalizedString(DiskStoreImpl.this.getName(), dae), dae); _testHandleDiskAccessException.countDown(); } catch (Exception e) { logger.error(LocalizedMessage.create(LocalizedStrings.LocalRegion_AN_EXCEPTION_OCCURED_WHILE_CLOSING_THE_CACHE), e); } } };
private void initLastModifiedTime(long lastModifiedTime) { if (lastModifiedTime == 0) { lastModifiedTime = getParent().getCache().cacheTimeMillis(); } this.lastModifiedTime = lastModifiedTime; this.lmtBytes = InternalDataSerializer .getUnsignedVLSize(lastModifiedTime); this.size += this.lmtBytes; }
public void scheduleIndexRecovery(Set<Oplog> allOplogs, boolean recreateIndexes) { // schedule index recovery atmost once if (markIndexRecoveryScheduled()) { IndexRecoveryTask task = new IndexRecoveryTask(allOplogs, recreateIndexes); // other disk store threads wait for this task, so use a different // thread pool for execution if possible (not in loner VM) ThreadPoolExecutor executor = getCache() .getWaitingThreadPoolOrDiskWritePool(); executeDiskStoreTask(task, executor, true); } }
public void handleDiskAccessException(DiskAccessException dae, boolean b) { getDiskStore() .getCache() .getLoggerI18n() .error( LocalizedStrings.PlaceHolderDiskRegion_A_DISKACCESSEXCEPTION_HAS_OCCURED_WHILE_RECOVERING_FROM_DISK, getName(), dae); }
public void handleDiskAccessException(DiskAccessException dae) { getDiskStore() .getCache() .getLoggerI18n() .error( LocalizedStrings.PlaceHolderDiskRegion_A_DISKACCESSEXCEPTION_HAS_OCCURED_WHILE_RECOVERING_FROM_DISK, getName(), dae); }
private void startAsyncFlusher() { final String thName = LocalizedStrings.DiskRegion_ASYNCHRONOUS_DISK_WRITER_0 .toLocalizedString(new Object[] { getName() }); this.flusherThread = new Thread(LogWriterImpl.createThreadGroup( LocalizedStrings.DiskRegion_DISK_WRITERS.toLocalizedString(), getCache().getDistributedSystem().getLogWriter() .convertToLogWriterI18n()), new FlusherThread(), thName); this.flusherThread.setDaemon(true); this.flusherThread.start(); }
public PersistentMemberID generatePersistentID(DiskRegionView dr) { File firstDir = getInfoFileDir().getDir(); InternalDistributedSystem ids = getCache().getDistributedSystem(); InternalDistributedMember memberId = ids.getDistributionManager() .getDistributionManagerId(); //NOTE - do NOT use DM.cacheTimeMillis here. See bug #49920 long timestamp = System.currentTimeMillis(); PersistentMemberID id = new PersistentMemberID(getDiskStoreID(), memberId.getIpAddress(), firstDir.getAbsolutePath(), memberId.getName(), timestamp, (short) 0); return id; }
public PersistentMemberID generatePersistentID(DiskRegionView dr) { File firstDir = getInfoFileDir().getDir(); InternalDistributedSystem ids = getCache().getDistributedSystem(); InternalDistributedMember memberId = ids.getDistributionManager() .getDistributionManagerId(); //NOTE - do NOT use DM.cacheTimeMillis here. See bug #49920 long timestamp = System.currentTimeMillis(); PersistentMemberID id = new PersistentMemberID(getDiskStoreID(), memberId.getInetAddress(), firstDir.getAbsolutePath(), memberId.getName(), timestamp, (short) 0); return id; }
private synchronized VersionTag createDummyTag(DiskRecoveryStore drs) { DiskStoreID member = getParent().getDiskStoreID(); int memberid = getParent().getDiskInitFile().getOrCreateCanonicalId(member); long regionVersion = drs.getVersionForMember(member); VersionTag vt = VersionTag.create(member); vt.setEntryVersion(1); vt.setRegionVersion(regionVersion + 1); vt.setMemberID(member); vt.setVersionTimeStamp(getParent().getCache().cacheTimeMillis()); vt.setDistributedSystemId(-1); return vt; }