public void finish(Set<InetAddress> hintedNodes) { for (int i = 0; i < replayHandlers.size(); i++) { ReplayWriteResponseHandler<Mutation> handler = replayHandlers.get(i); try { handler.get(); } catch (WriteTimeoutException|WriteFailureException e) { logger.trace("Failed replaying a batched mutation to a node, will write a hint"); logger.trace("Failure was : {}", e.getMessage()); // writing hints for the rest to hints, starting from i writeHintsForUndeliveredEndpoints(i, hintedNodes); return; } } }
public AuthenticatedUser authenticate(Map<String, String> credentials) throws AuthenticationException { String username = credentials.get(USERNAME_KEY); if (username == null) throw new AuthenticationException(String.format("Required key '%s' is missing", USERNAME_KEY)); String password = credentials.get(PASSWORD_KEY); if (password == null) throw new AuthenticationException(String.format("Required key '%s' is missing", PASSWORD_KEY)); UntypedResultSet result; try { ResultMessage.Rows rows = authenticateStatement.execute(QueryState.forInternalCalls(), QueryOptions.forInternalCalls(consistencyForUser(username), Lists.newArrayList(ByteBufferUtil.bytes(username)))); result = UntypedResultSet.create(rows.result); } catch (RequestValidationException e) { throw new AssertionError(e); // not supposed to happen } catch (RequestExecutionException e) { throw new AuthenticationException(e.toString()); } if (result.isEmpty() || !BCrypt.checkpw(password, result.one().getString(SALTED_HASH))) throw new AuthenticationException("Username and/or password are incorrect"); return new AuthenticatedUser(username); }
public void finish(Set<InetAddress> hintedNodes) { for (int i = 0; i < replayHandlers.size(); i++) { ReplayWriteResponseHandler<Mutation> handler = replayHandlers.get(i); try { handler.get(); } catch (WriteTimeoutException|WriteFailureException e) { logger.trace("Failed replaying a batched mutation to a node, will write a hint"); logger.trace("Failure was : {}", e.getMessage()); // writing hints for the rest to hints, starting from i writeHintsForUndeliveredEndpoints(i, hintedNodes); return; } } }
public void finish(Set<InetAddress> hintedNodes) { for (int i = 0; i < replayHandlers.size(); i++) { ReplayWriteResponseHandler<Mutation> handler = replayHandlers.get(i); try { handler.get(); } catch (WriteTimeoutException|WriteFailureException e) { logger.trace("Failed replaying a batched mutation to a node, will write a hint"); logger.trace("Failure was : {}", e.getMessage()); // writing hints for the rest to hints, starting from i writeHintsForUndeliveredEndpoints(i, hintedNodes); return; } } }