@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(); }
public static RuntimeException handleLeadNodeRuntimeException( RuntimeException re) { Throwable cause = re; if (re instanceof GemFireXDRuntimeException || re instanceof FunctionException || re instanceof FunctionExecutionException || re instanceof ReplyException) { cause = re.getCause(); } if (cause instanceof RegionDestroyedException) { RegionDestroyedException rde = (RegionDestroyedException)cause; // don't mark as remote so that no retry is done (SNAP-961) // a top-level exception can only have been from lead node itself if (rde.isRemote()) rde.setNotRemote(); } if (cause instanceof DiskAccessException) { DiskAccessException dae = (DiskAccessException)cause; // don't mark as remote so that no retry is done (SNAP-961) // a top-level exception can only have been from lead node itself if (dae.isRemote()) dae.setNotRemote(); } return re; }
/** * Return true if dae was caused by a RegionDestroyedException. * This was added for bug 39603. */ static boolean causedByRDE(DiskAccessException dae) { boolean result = false; if (dae != null) { Throwable cause = dae.getCause(); while (cause != null) { if (cause instanceof RegionDestroyedException) { result = true; break; } cause = cause.getCause(); } } return result; }
"Async writer thread stopping due to unexpected interrupt"); } catch (DiskAccessException dae) { boolean okToIgnore = dae.getCause() instanceof ClosedByInterruptException; if (!okToIgnore || !stopFlusher) { fatalDae = dae; } catch(Throwable t) { logger.fatal(LocalizedMessage.create(LocalizedStrings.DiskStoreImpl_FATAL_ERROR_ON_FLUSH), t); fatalDae = new DiskAccessException(LocalizedStrings.DiskStoreImpl_FATAL_ERROR_ON_FLUSH.toLocalizedString(), t, DiskStoreImpl.this); } finally { if (logger.isDebugEnabled()) {
protected List<GFXDSnapshotExportStat> extractDiskStores(String serverName, List<DiskStoreImpl> diskStores, List<String> diskStoreDirectories, String serverOutputDirectory) throws Exception { logInfo("Server : " + serverName + " Started extraction of disk stores..."); List<GFXDSnapshotExportStat> listOfStatsObjects = new ArrayList<GFXDSnapshotExportStat>(); for (String diskStoreDirectory: diskStoreDirectories) { diskStoreDirectory = diskStoreDirectory.trim(); for (DiskStoreImpl diskStore : diskStores) { try { List<GFXDSnapshotExportStat> listOfStats = extractDiskStore(serverName, diskStore, diskStoreDirectory, serverOutputDirectory); listOfStatsObjects.addAll(listOfStats); } catch (IllegalStateException e) { //most likely due to not having the file associated to a disk store in a different directory //logger.error("disk store:" + diskStore.getName() + " was not recovered in directory:" + diskStoreDirectory + " due to :" + e.getMessage()); //System.out.println("disk store:" + diskStore.getName() + " was not recovered in directory:" + diskStoreDirectory + " due to :" + e.getMessage()); logInfo("Disk-store:" + diskStore.getName() + " was not recovered from directory : " + diskStoreDirectory, e); } catch (DiskAccessException e) { logSevere("Could not access files for " + diskStore.getName() + " from directory " + diskStoreDirectory + " due to: " + e.getMessage(), reportableErrors); } } } logInfo("Server : " + serverName + " Completed extraction of disk stores"); return listOfStatsObjects; }
&& ((DiskAccessException)t).isRemote()) { return true;
private synchronized void writeObject(final java.io.ObjectOutputStream out) throws IOException { getStackTrace(); // Ensure that stackTrace field is initialized. out.defaultWriteObject(); }
} catch (DiskAccessException dae) { boolean okToIgnore = dae.getCause() instanceof ClosedByInterruptException; if (!okToIgnore || !stopFlusher) { fatalDae = dae; fatalDae = new DiskAccessException(LocalizedStrings.DiskStoreImpl_FATAL_ERROR_ON_FLUSH.toLocalizedString(), t, DiskStoreImpl.this); } finally {
protected List<GFXDSnapshotExportStat> extractDiskStores(String serverName, List<DiskStoreImpl> diskStores, List<String> diskStoreDirectories, String serverOutputDirectory) throws Exception { logInfo("Server : " + serverName + " Started extraction of disk stores..."); List<GFXDSnapshotExportStat> listOfStatsObjects = new ArrayList<GFXDSnapshotExportStat>(); for (String diskStoreDirectory: diskStoreDirectories) { diskStoreDirectory = diskStoreDirectory.trim(); for (DiskStoreImpl diskStore : diskStores) { try { List<GFXDSnapshotExportStat> listOfStats = extractDiskStore(serverName, diskStore, diskStoreDirectory, serverOutputDirectory); listOfStatsObjects.addAll(listOfStats); } catch (IllegalStateException e) { //most likely due to not having the file associated to a disk store in a different directory //logger.error("disk store:" + diskStore.getName() + " was not recovered in directory:" + diskStoreDirectory + " due to :" + e.getMessage()); //System.out.println("disk store:" + diskStore.getName() + " was not recovered in directory:" + diskStoreDirectory + " due to :" + e.getMessage()); logInfo("Disk-store:" + diskStore.getName() + " was not recovered from directory : " + diskStoreDirectory, e); } catch (DiskAccessException e) { logSevere("Could not access files for " + diskStore.getName() + " from directory " + diskStoreDirectory + " due to: " + e.getMessage(), reportableErrors); } } } logInfo("Server : " + serverName + " Completed extraction of disk stores"); return listOfStatsObjects; }
&& ((DiskAccessException)t).isRemote()) { return true;
private synchronized void writeObject(final java.io.ObjectOutputStream out) throws IOException { getStackTrace(); // Ensure that stackTrace field is initialized. out.defaultWriteObject(); }
@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); }
protected List<GFXDSnapshotExportStat> extractDiskStores(String serverName, List<DiskStoreImpl> diskStores, List<String> diskStoreDirectories, String serverOutputDirectory) throws Exception { logInfo("Server : " + serverName + " Started extraction of disk stores..."); List<GFXDSnapshotExportStat> listOfStatsObjects = new ArrayList<GFXDSnapshotExportStat>(); for (String diskStoreDirectory: diskStoreDirectories) { diskStoreDirectory = diskStoreDirectory.trim(); for (DiskStoreImpl diskStore : diskStores) { try { List<GFXDSnapshotExportStat> listOfStats = extractDiskStore(serverName, diskStore, diskStoreDirectory, serverOutputDirectory); listOfStatsObjects.addAll(listOfStats); } catch (IllegalStateException e) { //most likely due to not having the file associated to a disk store in a different directory //logger.error("disk store:" + diskStore.getName() + " was not recovered in directory:" + diskStoreDirectory + " due to :" + e.getMessage()); //System.out.println("disk store:" + diskStore.getName() + " was not recovered in directory:" + diskStoreDirectory + " due to :" + e.getMessage()); logInfo("Disk-store:" + diskStore.getName() + " was not recovered from directory : " + diskStoreDirectory, e); } catch (DiskAccessException e) { logSevere("Could not access files for " + diskStore.getName() + " from directory " + diskStoreDirectory + " due to: " + e.getMessage(), reportableErrors); } } } logInfo("Server : " + serverName + " Completed extraction of disk stores"); return listOfStatsObjects; }
&& ((DiskAccessException)t).isRemote()) { return true;
/** * Return true if dae was caused by a RegionDestroyedException. * This was added for bug 39603. */ static boolean causedByRDE(DiskAccessException dae) { boolean result = false; if (dae != null) { Throwable cause = dae.getCause(); while (cause != null) { if (cause instanceof RegionDestroyedException) { result = true; break; } cause = cause.getCause(); } } return result; }
/** * Overridden setValue method to throw exception */ public void setValue(LocalRegion r, Object v) throws RegionClearedException { throw new DiskAccessException(new IOException("Test Exception")); }
fail("expected DiskAccessException"); } catch (com.gemstone.gemfire.cache.DiskAccessException expected) { if (!expected.getMessage().contains("two different directories")) { fail("did not expect: " + expected + ". It should have contained: \"two different directories\""); fail("expected DiskAccessException"); } catch (com.gemstone.gemfire.cache.DiskAccessException expected) { if (!expected.getMessage().contains("does not belong")) { fail("did not expect: " + expected + ". It should have contained: \"does not belong\"");
if (dae != null && dae.isRemote()) { return;
public void createRegion () { try { region = cache.createRegion(regionName, attr); } catch (RegionExistsException reex){ Log.getLogWriter().info("RegionExistsException...may occur in concurrent environment. Continuing with test."); } catch (DiskAccessException dae) { Throwable cause = dae.getCause(); if (cause instanceof RegionDestroyedException) Log.getLogWriter().info("RegionDestroyedException...may occur in concurrent environment. Continuing with test."); else throw new TestException(TestHelper.getStackTrace(dae)); } catch (Exception ex) { throw new TestException(TestHelper.getStackTrace(ex)); } }//end of createRegion
public final RegionEntry createEntry(RegionEntryContext r, Object key, Object value) { throw new DiskAccessException(new IOException("Test Exception")); //return new Bug39079DUnitTest.TestAbstractDiskRegionEntry(r, key, value); }