synchronized RetriesExhaustedWithDetailsException makeException(boolean logDetails) { if (logDetails) { LOG.error("Exception occurred! Exception details: " + throwables + ";\nActions: " + actions); } return new RetriesExhaustedWithDetailsException(new ArrayList<>(throwables), new ArrayList<>(actions), new ArrayList<>(addresses)); }
private static RetriesExhaustedWithDetailsException makeException( List<RetriesExhaustedWithDetailsException> errors) { switch (errors.size()) { case 0: return null; case 1: return errors.get(0); default: List<Throwable> exceptions = new ArrayList<>(); List<Row> actions = new ArrayList<>(); List<String> hostnameAndPort = new ArrayList<>(); errors.forEach(e -> { exceptions.addAll(e.exceptions); actions.addAll(e.actions); hostnameAndPort.addAll(e.hostnameAndPort); }); return new RetriesExhaustedWithDetailsException(exceptions, actions, hostnameAndPort); } }
/** * Assert that a RetriesExhaustedException that has RegionTooBusyException outputs region name. */ @Test public void testRegionTooBusyException() { List<Throwable> ts = new ArrayList<>(1); final String regionName = this.name.getMethodName(); ts.add(new RegionTooBusyException(regionName)); List<Row> rows = new ArrayList<>(1); rows.add(Mockito.mock(Row.class)); List<String> hostAndPorts = new ArrayList<>(1); hostAndPorts.add("example.com:1234"); RetriesExhaustedException ree = new RetriesExhaustedWithDetailsException(ts, rows, hostAndPorts); assertTrue(ree.toString().contains(regionName)); } }
throw future.getErrors(); } else if (!callbackErrorExceptions.isEmpty()) { throw new RetriesExhaustedWithDetailsException(callbackErrorExceptions, callbackErrorActions, callbackErrorServers);
synchronized RetriesExhaustedWithDetailsException makeException(boolean logDetails) { if (logDetails) { LOG.error("Exception occurred! Exception details: " + throwables + ";\nActions: " + actions); } return new RetriesExhaustedWithDetailsException(new ArrayList<>(throwables), new ArrayList<>(actions), new ArrayList<>(addresses)); }
private static RetriesExhaustedWithDetailsException makeException( List<RetriesExhaustedWithDetailsException> errors) { switch (errors.size()) { case 0: return null; case 1: return errors.get(0); default: List<Throwable> exceptions = new ArrayList<>(); List<Row> actions = new ArrayList<>(); List<String> hostnameAndPort = new ArrayList<>(); errors.forEach(e -> { exceptions.addAll(e.exceptions); actions.addAll(e.actions); hostnameAndPort.addAll(e.hostnameAndPort); }); return new RetriesExhaustedWithDetailsException(exceptions, actions, hostnameAndPort); } }
/** * Assert that a RetriesExhaustedException that has RegionTooBusyException outputs region name. */ @Test public void testRegionTooBusyException() { List<Throwable> ts = new ArrayList<>(1); final String regionName = this.name.getMethodName(); ts.add(new RegionTooBusyException(regionName)); List<Row> rows = new ArrayList<>(1); rows.add(Mockito.mock(Row.class)); List<String> hostAndPorts = new ArrayList<>(1); hostAndPorts.add("example.com:1234"); RetriesExhaustedException ree = new RetriesExhaustedWithDetailsException(ts, rows, hostAndPorts); assertTrue(ree.toString().contains(regionName)); } }
throw future.getErrors(); } else if (!callbackErrorExceptions.isEmpty()) { throw new RetriesExhaustedWithDetailsException(callbackErrorExceptions, callbackErrorActions, callbackErrorServers);
synchronized RetriesExhaustedWithDetailsException makeException(boolean logDetails) { if (logDetails) { LOG.error("Exception occurred! Exception details: " + throwables + ";\nActions: " + actions); } return new RetriesExhaustedWithDetailsException(new ArrayList<>(throwables), new ArrayList<>(actions), new ArrayList<>(addresses)); }
private synchronized RetriesExhaustedWithDetailsException makeException() { return new RetriesExhaustedWithDetailsException( new ArrayList<Throwable>(throwables), new ArrayList<Row>(actions), new ArrayList<String>(addresses)); }
private RetriesExhaustedWithDetailsException createRetriesExhaustedWithDetailsException(Throwable e, Row action) { return new RetriesExhaustedWithDetailsException(Arrays.asList(e), Arrays.asList(action), Arrays.asList(options.getDataHost().toString())); }
private RetriesExhaustedWithDetailsException createRetriesExhaustedWithDetailsException(Throwable e, Row action) { return new RetriesExhaustedWithDetailsException(Arrays.asList(e), Arrays.asList(action), Arrays.asList(options.getDataHost().toString())); }
private static RetriesExhaustedWithDetailsException makeException( List<RetriesExhaustedWithDetailsException> errors) { switch (errors.size()) { case 0: return null; case 1: return errors.get(0); default: List<Throwable> exceptions = new ArrayList<>(); List<Row> actions = new ArrayList<>(); List<String> hostnameAndPort = new ArrayList<>(); errors.forEach(e -> { exceptions.addAll(e.exceptions); actions.addAll(e.actions); hostnameAndPort.addAll(e.hostnameAndPort); }); return new RetriesExhaustedWithDetailsException(exceptions, actions, hostnameAndPort); } }
return new RetriesExhaustedWithDetailsException(problems, failedMutations, hostnames);
return new RetriesExhaustedWithDetailsException(problems, failedMutations, hostnames);
throw new RetriesExhaustedWithDetailsException(problems, problemActions, hosts);
throw new RetriesExhaustedWithDetailsException(problems, problemActions, hosts);
@Override public Object answer(InvocationOnMock a) throws Throwable { List<Increment> increments = (List<Increment>) a.getArguments()[0]; Object[] objects = (Object[]) a.getArguments()[1]; int size = increments.size(); List<Row> failedOperations = new ArrayList<>(); List<Throwable> throwables = new ArrayList<>(); List<String> hosts = new ArrayList<>(); for (int i = 0; i < size; ++i) { if (i % 2 == 1) { failedOperations.add(increments.get(i)); throwables.add(new IOException("ughhh " + i)); hosts.add("host: " + i); objects[i] = null; } else { incrementOperations.add(increments.get(i)); objects[i] = new Result(new KeyValue[]{new KeyValue( increments.get(i).getRow(), CF, HBaseDbHarness.QUALIFIER, Longs.toByteArray(increments.get(i).getFamilyMap().get(CF).get(HBaseDbHarness.QUALIFIER)) )}); } } if (!failedOperations.isEmpty()) { throw new RetriesExhaustedWithDetailsException(throwables, failedOperations, hosts); } return objects; } }
throw future.getErrors(); } else if (!callbackErrorExceptions.isEmpty()) { throw new RetriesExhaustedWithDetailsException(callbackErrorExceptions, callbackErrorActions, callbackErrorServers);
throw future.getErrors(); } else if (!callbackErrorExceptions.isEmpty()) { throw new RetriesExhaustedWithDetailsException(callbackErrorExceptions, callbackErrorActions, callbackErrorServers);