@Override public void afterWriteGCRVV(DiskRegion dr) { //This will cause the disk store to shut down, //preventing us from writing any other records. throw new DiskAccessException(); }
@Override public void beforeDeletingCompactedOplog(Oplog oplog) { //destroy the oplog //This will cause DiskAccessException where the compactor will // attempt to destroy the region. throw new DiskAccessException("IGNORE_EXCEPTION_testCompactorClose GeneratedException",region); }
/** * Overridden setValue method to throw exception */ public void setValue(LocalRegion r, Object v) throws RegionClearedException { throw new DiskAccessException(new IOException("Test Exception")); }
public final RegionEntry createEntry(RegionEntryContext r, Object key, Object value) { throw new DiskAccessException(new IOException("Test Exception")); //return new Bug39079DUnitTest.TestAbstractDiskRegionEntry(r, key, value); }
@Override protected RuntimeException getFailureException(String reason, Throwable t) { final DiskStoreImpl dsi = SortedIndexRecoveryJob.this.dsi; return dsi != null ? new DiskAccessException(reason, t, dsi) : new GemFireIOException(reason, t); } }
public void call(LocalRegion r, Operation op, RegionEntry re) { if (TROUBLE_KEY.equals(re.getKey())) { throw new DiskAccessException(TROUBLE_KEY, r); } } }
public static Path createPersistentDir(String baseDir, String dirPath) { Path dir = generatePersistentDirName(baseDir, dirPath); try { return Files.createDirectories(dir).toRealPath(LinkOption.NOFOLLOW_LINKS); } catch (IOException ioe) { throw new DiskAccessException("Could not create directory for " + "system disk store: " + dir.toString(), ioe); } }
@Override protected RuntimeException getFailureException(String reason, Throwable t) { final DiskStoreImpl dsi = SortedIndexRecoveryJobPart.this.dsi; return dsi != null ? new DiskAccessException(reason, t, dsi) : new GemFireIOException(reason, t); } }
public final void flushAll() { try { flush(); } catch (IOException ex) { throw new DiskAccessException(LocalizedStrings.Oplog_FAILED_WRITING_KEY_TO_0.toLocalizedString(this.diskFile.getPath()), ex, this.parent); } }
@Override public void oplogRecovered(long oplogId) { try { writer.writeBatch(currentOplogEntries); } catch(IOException e) { throw new DiskAccessException("Error during export", e, this.getDiskStore()); } currentOplogEntries.clear(); }
@Override public void oplogRecovered(long oplogId) { try { writer.writeBatch(currentOplogEntries); } catch(IOException e) { throw new DiskAccessException("Error during export", e, this.getDiskStore()); } currentOplogEntries.clear(); }
public final void flushAll() { try { flush(); } catch (IOException ex) { throw new DiskAccessException(LocalizedStrings.Oplog_FAILED_WRITING_KEY_TO_0.toLocalizedString(this.diskFile.getPath()), ex, this.parent); } }
private void checkForFlusherThreadTermination() { if (this.flusherThreadTerminated) { String message = "Could not schedule asynchronous write because the flusher thread had been terminated."; if(this.isClosing()) { // for bug 41305 throw this.cache .getCacheClosedException(message, null); } else { throw new DiskAccessException(message, this); } } }
private void checkForFlusherThreadTermination() { if (this.flusherThreadTerminated) { String message = "Could not schedule asynchronous write because the flusher thread had been terminated."; if(this.isClosing()) { // for bug 41305 throw this.cache .getCacheClosedException(message, null); } else { throw new DiskAccessException(message, this); } } }
public final boolean copyForwardForOverflowCompact(DiskEntry entry, DiskEntry.Helper.ValueWrapper value, byte userBits) { try { return basicModify(entry, value, 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()); } }
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 Version readProductVersionRecord(DataInput dis, File f) throws IOException { Version recoveredGFVersion; short ver = Version.readOrdinal(dis); try { recoveredGFVersion = Version.fromOrdinal(ver, false); } catch (UnsupportedVersionException e) { throw new DiskAccessException(LocalizedStrings.Oplog_UNEXPECTED_PRODUCT_VERSION_0.toLocalizedString(ver), e, getParent()); } logger.trace(LogMarker.PERSIST_RECOVERY, "version={}", recoveredGFVersion); readEndOfRecord(dis); return recoveredGFVersion; }
private byte[] pmidToBytes(PersistentMemberID id) { try { HeapDataOutputStream hdos = new HeapDataOutputStream(Version.CURRENT); InternalDataSerializer.invokeToData(id, hdos); return hdos.toByteArray(); } catch (IOException ex) { throw new DiskAccessException(LocalizedStrings.DiskInitFile_FAILED_INIT_FILE_WRITE_BECAUSE_0.toLocalizedString(ex), this.parent); } }
private byte[] pmidToBytes(PersistentMemberID id) { try { HeapDataOutputStream hdos = new HeapDataOutputStream(Version.CURRENT); InternalDataSerializer.invokeToData(id, hdos); return hdos.toByteArray(); } catch (IOException ex) { throw new DiskAccessException(LocalizedStrings.DiskInitFile_FAILED_INIT_FILE_WRITE_BECAUSE_0.toLocalizedString(ex), this.parent); } }
public final void flushAll(boolean skipDrf, boolean doSync, boolean dofsync) { try { // if (!skipDrf) { // @todo if skipDrf then only need to do drf if crf has flushable data flush(this.drf, doSync, dofsync); // } flush(this.crf, doSync, dofsync); } catch (IOException ex) { getParent().getCancelCriterion().checkCancelInProgress(ex); throw new DiskAccessException(LocalizedStrings.Oplog_FAILED_WRITING_KEY_TO_0.toLocalizedString(this.diskFile.getPath()), ex, getParent()); } }