/** * Checks if the exception is CallQueueTooBig exception (maybe wrapped * into some RemoteException). * @param t exception to check * @return true if it's a CQTBE, false otherwise */ public static boolean isCallQueueTooBigException(Throwable t) { t = findException(t); return (t instanceof CallQueueTooBigException); }
/** * Checks if the exception is CallDroppedException (maybe wrapped * into some RemoteException). * @param t exception to check * @return true if it's a CQTBE, false otherwise */ public static boolean isCallDroppedException(Throwable t) { t = findException(t); return (t instanceof CallDroppedException); }
protected static Throwable unwrap(Throwable t) { if (t == null) { return t; } if (t instanceof TIOError || t instanceof IOError) { t = t.getCause(); } return ClientExceptionsUtil.findException(t); } }
public static boolean isMetaClearingException(Throwable cur) { cur = findException(cur); if (cur == null) { return true; } return !isSpecialException(cur) || (cur instanceof RegionMovedException) || cur instanceof NotServingRegionException; }
static void updateCachedLocationOnError(HRegionLocation loc, Throwable exception, Function<HRegionLocation, HRegionLocation> cachedLocationSupplier, Consumer<HRegionLocation> addToCache, Consumer<HRegionLocation> removeFromCache) { HRegionLocation oldLoc = cachedLocationSupplier.apply(loc); LOG.debug("Try updating {} , the old value is {}", loc, oldLoc, exception); if (!canUpdateOnError(loc, oldLoc)) { return; } Throwable cause = findException(exception); LOG.debug("The actual exception when updating {}", loc, cause); if (cause == null || !isMetaClearingException(cause)) { LOG.debug("Will not update {} because the exception is null or not the one we care about", loc); return; } if (cause instanceof RegionMovedException) { RegionMovedException rme = (RegionMovedException) cause; HRegionLocation newLoc = new HRegionLocation(loc.getRegion(), rme.getServerName(), rme.getLocationSeqNum()); LOG.debug("Try updating {} with the new location {} constructed by {}", loc, newLoc, rme); addToCache.accept(newLoc); } else { LOG.debug("Try removing {} from cache", loc); removeFromCache.accept(loc); } }
@Test public void testFindException() throws Exception { IOException ioe = new IOException("Tesst"); ServiceException se = new ServiceException(ioe); assertEquals(ioe, ClientExceptionsUtil.findException(se)); } }
Row row = sentAction.getAction(); lastException = regionException != null ? regionException : ClientExceptionsUtil.findException(actionException);
/** * Checks if the exception is CallQueueTooBig exception (maybe wrapped * into some RemoteException). * @param t exception to check * @return true if it's a CQTBE, false otherwise */ public static boolean isCallQueueTooBigException(Throwable t) { t = findException(t); return (t instanceof CallQueueTooBigException); }
/** * Checks if the exception is CallDroppedException (maybe wrapped * into some RemoteException). * @param t exception to check * @return true if it's a CQTBE, false otherwise */ public static boolean isCallDroppedException(Throwable t) { t = findException(t); return (t instanceof CallDroppedException); }
Throwable cause = ClientExceptionsUtil.findException(exception); if (cause != null) { if (!ClientExceptionsUtil.isMetaClearingException(cause)) {
public static boolean isMetaClearingException(Throwable cur) { cur = findException(cur); if (cur == null) { return true; } return !isSpecialException(cur) || (cur instanceof RegionMovedException) || cur instanceof NotServingRegionException; }
return; Throwable cause = findException(exception); if (LOG.isDebugEnabled()) { LOG.debug("The actual exception when updating " + loc, cause);
Throwable cause = ClientExceptionsUtil.findException(e.getCause(0)); Assert.assertNotNull(cause); Assert.assertTrue(cause instanceof RegionMovedException); Throwable cause = ClientExceptionsUtil.findException(ree.getCause()); Assert.assertNotNull(cause); Assert.assertTrue(cause instanceof RegionMovedException);
@Test public void testFindException() throws Exception { IOException ioe = new IOException("Tesst"); ServiceException se = new ServiceException(ioe); assertEquals(ioe, ClientExceptionsUtil.findException(se)); } }
Row row = sentAction.getAction(); lastException = regionException != null ? regionException : ClientExceptionsUtil.findException(actionException);
/** * Checks if the exception is CallDroppedException (maybe wrapped * into some RemoteException). * @param t exception to check * @return true if it's a CQTBE, false otherwise */ public static boolean isCallDroppedException(Throwable t) { t = findException(t); return (t instanceof CallDroppedException); }
/** * Checks if the exception is CallQueueTooBig exception (maybe wrapped * into some RemoteException). * @param t exception to check * @return true if it's a CQTBE, false otherwise */ public static boolean isCallQueueTooBigException(Throwable t) { t = findException(t); return (t instanceof CallQueueTooBigException); }
private static Throwable unwrap(Throwable t) { if (t == null) { return t; } if (t instanceof TIOError || t instanceof IOError) { t = t.getCause(); } return ClientExceptionsUtil.findException(t); } }
private static Throwable unwrap(Throwable t) { if (t == null) { return t; } if (t instanceof TIOError || t instanceof IOError) { t = t.getCause(); } return ClientExceptionsUtil.findException(t); } }
Throwable cause = ClientExceptionsUtil.findException(exception); if (cause != null) { if (!ClientExceptionsUtil.isMetaClearingException(cause)) {