public void removeDiskStore(DiskStoreImpl ds) { if (logger.isTraceEnabled(LogMarker.DISK_STORE_MONITOR)) { logger.trace(LogMarker.DISK_STORE_MONITOR, "No longer monitoring disk store {}", ds.getName()); } disks.remove(ds); }
/** * Call this when the cache is closed or region is destroyed. Deletes the lock * files. */ public void close() { if (this.closed) { return; } if (logger.isDebugEnabled()) { logger.debug("Oplog::close: Store name ={} Oplog ID = {}", parent.getName(), oplogId); } basicClose(false); }
private void deleteFileOnRecovery(File f) { try { if(f.delete()) { parent.logger.info(LocalizedStrings.DiskStoreImpl_DELETE_ON_RECOVERY, new Object[] {f.getName(), parent.getName()}); } }catch(Exception e) { //ignore, one more attempt to delete the file failed } }
private static List<DiskStoreImpl> listDiskStores(boolean includeDataDictionary) { List<DiskStoreImpl> diskStoresList = new ArrayList<DiskStoreImpl>(); GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); Collection<DiskStoreImpl> diskStores = cache.listDiskStoresIncludingRegionOwned(); for (DiskStoreImpl diskStore : diskStores) { if (!diskStore.getName().equals(GfxdConstants.GFXD_DD_DISKSTORE_NAME) || includeDataDictionary) { diskStoresList.add(diskStore); } } return diskStoresList; }
private static List<DiskStoreImpl> listDiskStores(boolean includeDataDictionary) { List<DiskStoreImpl> diskStoresList = new ArrayList<DiskStoreImpl>(); GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); Collection<DiskStoreImpl> diskStores = cache.listDiskStoresIncludingRegionOwned(); for (DiskStoreImpl diskStore : diskStores) { if (!diskStore.getName().equals(GfxdConstants.GFXD_DD_DISKSTORE_NAME) || includeDataDictionary) { diskStoresList.add(diskStore); } } return diskStoresList; }
public void run() { if (!krf.delete()) { if (krf.exists()) { logger.warn(LocalizedMessage.create(LocalizedStrings.Oplog_DELETE_FAIL_0_1_2, new Object[] { Oplog.this.toString(), "krf", getParent().getName() })); } } else { logger.info(LocalizedMessage.create(LocalizedStrings.Oplog_DELETE_0_1_2, new Object[] { Oplog.this.toString(), "krf", getParent().getName() })); } } });
public void run() { if (!olf.f.delete() && olf.f.exists()) { logger.warn(LocalizedMessage.create(LocalizedStrings.Oplog_DELETE_FAIL_0_1_2, new Object[] { Oplog.this.toString(), getFileType(olf), getParent().getName() })); } else { logger.info(LocalizedMessage.create(LocalizedStrings.Oplog_DELETE_0_1_2, new Object[] { Oplog.this.toString(), getFileType(olf), getParent().getName() })); } } });
public void addDiskStore(DiskStoreImpl ds) { if (logger.isTraceEnabled(LogMarker.DISK_STORE_MONITOR)) { logger.trace(LogMarker.DISK_STORE_MONITOR, "Now monitoring disk store {}", ds.getName()); } Set<DirectoryHolderUsage> du = new HashSet<DirectoryHolderUsage>(); for (DirectoryHolder dir : ds.getDirectoryHolders()) { du.add(new DirectoryHolderUsage(ds, dir)); } disks.put(ds, du); }
/** * Returns the dir name used to back up this DiskStore's directories under. * The name is a concatenation of the disk store name and id. */ public String getBackupDirName() { String name = getName(); if(name == null) { name = GemFireCacheImpl.DEFAULT_DS_NAME; } return (name + "_" + getDiskStoreID().toString()); }
private void handleEmpty(boolean calledByCompactor) { if (!calledByCompactor) { logger.info(LocalizedMessage.create(LocalizedStrings.Oplog_CLOSING_EMPTY_OPLOG_0_1, new Object[] {this.parent.getName(), toString()})); } destroy(); }
public void addRegionOwnedDiskStore(DiskStoreImpl dsi) { this.regionOwnedDiskStores.put(dsi.getName(), dsi); if (!dsi.isOffline()) { getDiskStoreMonitor().addDiskStore(dsi); } }
public void addDiskStore(DiskStoreImpl dsi) { this.diskStores.put(dsi.getName(), dsi); if (!dsi.isOffline()) { getDiskStoreMonitor().addDiskStore(dsi); } }
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 startAsyncFlusher() { final String thName = LocalizedStrings.DiskRegion_ASYNCHRONOUS_DISK_WRITER_0 .toLocalizedString(new Object[] { getName() }); this.flusherThread = new Thread(LoggingThreadGroup.createThreadGroup( LocalizedStrings.DiskRegion_DISK_WRITERS.toLocalizedString(),logger), new FlusherThread(), thName); this.flusherThread.setDaemon(true); this.flusherThread.start(); }
public final boolean copyForwardForOverflowCompact(DiskEntry entry, byte[] value, int length, byte userBits) { try { ValueWrapper vw = new DiskEntry.Helper.CompactorValueWrapper(value, length); return basicModify(entry, vw, userBits, true); } catch (IOException ex) { throw new DiskAccessException(LocalizedStrings.Oplog_FAILED_WRITING_KEY_TO_0.toLocalizedString(this.diskFile.getPath()), ex, getParent().getName()); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); getParent().getCancelCriterion().checkCancelInProgress(ie); throw new DiskAccessException(LocalizedStrings.Oplog_FAILED_WRITING_KEY_TO_0_DUE_TO_FAILURE_IN_ACQUIRING_READ_LOCK_FOR_ASYNCH_WRITING.toLocalizedString(this.diskFile.getPath()), ie, getParent().getName()); } }
private void addInternalDiskStore(DiskStoreImpl ds, UUIDFactory factory) throws StandardException { if (ds != null) { UUID id = factory.recreateUUID(ds.getName()); GfxdDiskStoreDescriptor dsd = new GfxdDiskStoreDescriptor(dd, id, ds, ds.getDiskDirs()[0].getAbsolutePath()); dd.addDescriptor(dsd, null, DataDictionary.SYSDISKSTORES_CATALOG_NUM, false, dd.getTransactionExecute()); } }
private void handleEmpty(boolean calledByCompactor) { if (!calledByCompactor) { if (logger.infoEnabled()) { logger.info(LocalizedStrings.Oplog_CLOSING_EMPTY_OPLOG_0_1, new Object[] {this.parent.getName(), toString()}); } } destroy(); }
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(); }