} catch (AccumuloSecurityException e) { e.setTableInfo(getTableInfo()); log.debug("{}", e.getMessage(), e); fatalException = e; } catch (Throwable t) {
System.exit(1); } catch (AccumuloSecurityException e) { log.error("{}", e.getMessage(), e); System.exit(2); } catch (Exception e) {
@Override public void run() { HashSet<Path> uniqMapFiles = new HashSet<>(); for (List<PathSize> mapFiles : assignmentsPerTablet.values()) for (PathSize ps : mapFiles) uniqMapFiles.add(ps.path); log.debug("Assigning " + uniqMapFiles.size() + " map files to " + assignmentsPerTablet.size() + " tablets at " + location); try { List<KeyExtent> failures = assignMapFiles(context, location, assignmentsPerTablet); handleFailures(failures, "Not Serving Tablet"); } catch (AccumuloException e) { handleFailures(assignmentsPerTablet.keySet(), e.getMessage()); } catch (AccumuloSecurityException e) { handleFailures(assignmentsPerTablet.keySet(), e.getMessage()); } }
@Override public void run() { HashSet<Path> uniqMapFiles = new HashSet<Path>(); for (List<PathSize> mapFiles : assignmentsPerTablet.values()) for (PathSize ps : mapFiles) uniqMapFiles.add(ps.path); log.debug("Assigning " + uniqMapFiles.size() + " map files to " + assignmentsPerTablet.size() + " tablets at " + location); try { List<KeyExtent> failures = assignMapFiles(credentials, location, assignmentsPerTablet); handleFailures(failures, "Not Serving Tablet"); } catch (AccumuloException e) { handleFailures(assignmentsPerTablet.keySet(), e.getMessage()); } catch (AccumuloSecurityException e) { handleFailures(assignmentsPerTablet.keySet(), e.getMessage()); } }
@Override public void visit(State state, Environment env, Properties props) throws Exception { Connector conn = env.getConnector(); Random rand = (Random) state.get("rand"); @SuppressWarnings("unchecked") List<String> tableNames = (List<String>) state.get("tables"); String tableName = tableNames.get(rand.nextInt(tableNames.size())); try { Collection<Text> splits = conn.tableOperations().listSplits(tableName); log.debug("Table " + tableName + " had " + splits.size() + " splits"); } catch (TableNotFoundException e) { log.debug("listSplits " + tableName + " failed, doesnt exist"); } catch (AccumuloSecurityException ase) { log.debug("listSplits " + tableName + " failed, " + ase.getMessage()); } } }
public static void update(Writer t, ZooLock zooLock, Mutation m) { if (zooLock != null) putLockID(zooLock, m); while (true) { try { t.update(m); return; } catch (AccumuloException e) { log.error("{}", e.getMessage(), e); } catch (AccumuloSecurityException e) { log.error("{}", e.getMessage(), e); } catch (ConstraintViolationException e) { log.error("{}", e.getMessage(), e); // retrying when a CVE occurs is probably futile and can cause problems, see ACCUMULO-3096 throw new RuntimeException(e); } catch (TableNotFoundException e) { log.error("{}", e.getMessage(), e); } sleepUninterruptibly(1, TimeUnit.SECONDS); } }
log.error(e.getMessage(), e); response.addException(e); throw new UnauthorizedException(e, response);
log.error(e.getMessage(), e); response.addException(e); throw new UnauthorizedException(e, response);
ops.setProperty(tableName, propertyName, propertyValue); } catch (AccumuloSecurityException e) { log.error(e.getMessage(), e); response.addException(new QueryException(e)); throw new UnauthorizedException(e, response);
log.error(e.getMessage(), e); response.addException(e); throw new UnauthorizedException(e, response);
@Override public void dropAndDestroy() throws RyaDAOException { for (final String tableName : getTables()) { try { if (tableName != null) { drop(tableName); } } catch (final AccumuloSecurityException e) { logger.error(e.getMessage()); throw new RyaDAOException(e); } catch (final AccumuloException e) { logger.error(e.getMessage()); throw new RyaDAOException(e); } catch (final TableNotFoundException e) { logger.warn(e.getMessage()); } } destroy(); for(final AccumuloIndexer indexer : this.secondaryIndexers) { try { indexer.dropAndDestroy(); } catch(final Exception e) { logger.error("Failed to drop and destroy indexer", e); } } }
ops.removeProperty(tableName, propertyName); } catch (AccumuloSecurityException e) { log.error(e.getMessage(), e); response.addException(new QueryException(e)); throw new UnauthorizedException(e, response);
@Override public void dropAndDestroy() throws RyaDAOException { for (final String tableName : getTables()) { try { if (tableName != null) { drop(tableName); } } catch (final AccumuloSecurityException e) { logger.error(e.getMessage()); throw new RyaDAOException(e); } catch (final AccumuloException e) { logger.error(e.getMessage()); throw new RyaDAOException(e); } catch (final TableNotFoundException e) { logger.warn(e.getMessage()); } } destroy(); for(final AccumuloIndexer indexer : this.secondaryIndexers) { try { indexer.dropAndDestroy(); } catch(final Exception e) { logger.error("Failed to drop and destroy indexer", e); } } }
ops.flush(tableName, null, null, false); } catch (AccumuloSecurityException e) { log.error(e.getMessage(), e); response.addException(new QueryException(e)); throw new UnauthorizedException(e, response);
ops.revokeSystemPermission(userName, SystemPermission.valueOf(permission)); } catch (AccumuloSecurityException e) { log.error(e.getMessage(), e); response.addException(new QueryException(e)); throw new UnauthorizedException(e, response);
ops.grantSystemPermission(userName, SystemPermission.valueOf(permission)); } catch (AccumuloSecurityException e) { log.error(e.getMessage(), e); response.addException(new QueryException(e)); throw new UnauthorizedException(e, response);
throw new ConflictException(e, response); } catch (AccumuloSecurityException e) { log.error(e.getMessage(), e); response.addException(new QueryException(e)); throw new UnauthorizedException(e, response);
/** * This method completes the setup process and was redundant in all but of the tests. * * @param bucketsToUse * - the array of buckets to use */ private void completeSetup(Integer[] bucketsToUse) { try { deleteFile(fileName); aiad = new AccumuloIndexAgeDisplay(mockInstance, tableName, columns, userName, password, bucketsToUse); aiad.extractDataFromAccumulo(); aiad.logAgeSummary(); aiad.createAccumuloShellScript(fileName); } catch (AccumuloException ae) { log.error("Accumlo exception from our mock instance."); log.error(ae.getMessage()); } catch (AccumuloSecurityException ase) { log.error("Accumulo security exception from our mock instance"); log.error(ase.getMessage()); } }
/** * A test verifying the buckets are sorted in reverse order. */ @Test public void sortBucketsInReverseOrderTest() { Assert.assertNotNull(mockInstance); try { aiad = new AccumuloIndexAgeDisplay(mockInstance, tableName, columns, userName, password, new Integer[0]); aiad.setBuckets(null); Integer[] expected = {180, 90, 60, 30, 14, 7, 2}; Integer[] actual = aiad.getBuckets(); Assert.assertArrayEquals(expected, actual); Integer[] useExpectedWithTooSmallNumber = {1, 2, 3, 4, 5}; expected = new Integer[] {5, 4, 3, 2}; aiad.setBuckets(useExpectedWithTooSmallNumber); actual = aiad.getBuckets(); Assert.assertArrayEquals(expected, actual); } catch (AccumuloException ae) { log.error("Accumlo exception from our mock instance."); log.error(ae.getMessage()); } catch (AccumuloSecurityException ase) { log.error("Accumulo security exception from our mock instance"); log.error(ase.getMessage()); } }
@Test public void testCreateExistingUser() throws Exception { ClusterUser user0 = getUser(0); Connector conn = getConnector(); Set<String> currentUsers = conn.securityOperations().listLocalUsers(); // Ensure that the user exists if (!currentUsers.contains(user0.getPrincipal())) { PasswordToken token = null; if (!getCluster().getClientConfig().hasSasl()) { token = new PasswordToken(user0.getPassword()); } conn.securityOperations().createLocalUser(user0.getPrincipal(), token); } try { conn.securityOperations().createLocalUser(user0.getPrincipal(), new PasswordToken("better_fail")); fail("Creating a user that already exists should throw an exception"); } catch (AccumuloSecurityException e) { assertTrue("Expected USER_EXISTS error", SecurityErrorCode.USER_EXISTS == e.getSecurityErrorCode()); String msg = e.getMessage(); assertTrue("Error message didn't contain principal: '" + msg + "'", msg.contains(user0.getPrincipal())); } }