for (IteratorSetting setting : config.getIterators()) { String iteratorClass = setting.getIteratorClass(); if (!testClassLoad(tableName, iteratorClass, skviName)) { start == null ? EMPTY : TextUtil.getByteBuffer(start), end == null ? EMPTY : TextUtil.getByteBuffer(end), ByteBuffer.wrap(IteratorUtil.encodeIteratorSettings(config.getIterators())), ByteBuffer.wrap(CompactionStrategyConfigUtil.encode(config.getCompactionStrategy())));
@Override protected void doTableOp(final Shell shellState, final String tableName) throws AccumuloException, AccumuloSecurityException { // compact the tables if (cancel) { try { shellState.getAccumuloClient().tableOperations().cancelCompaction(tableName); Shell.log.info("Compaction canceled for table " + tableName); } catch (TableNotFoundException e) { throw new AccumuloException(e); } } else { try { if (compactionConfig.getWait()) { Shell.log.info("Compacting table ..."); } for (IteratorSetting iteratorSetting : compactionConfig.getIterators()) { ScanCommand.ensureTserversCanLoadIterator(shellState, tableName, iteratorSetting.getIteratorClass()); } shellState.getAccumuloClient().tableOperations().compact(tableName, compactionConfig); Shell.log.info("Compaction of table " + tableName + " " + (compactionConfig.getWait() ? "completed" : "started") + " for given range"); } catch (Exception ex) { throw new AccumuloException(ex); } } }
@Override public void compact(String tableName, CompactionConfig config) throws AccumuloSecurityException, TableNotFoundException, AccumuloException { if (!exists(tableName)) throw new TableNotFoundException(tableName, tableName, ""); if (config.getIterators().size() > 0 || config.getCompactionStrategy() != null) throw new UnsupportedOperationException( "Mock does not support iterators or compaction strategies for compactions"); }
for (IteratorSetting setting : config.getIterators()) { String iteratorClass = setting.getIteratorClass(); if (!testClassLoad(tableName, iteratorClass, skviName)) { start == null ? EMPTY : TextUtil.getByteBuffer(start), end == null ? EMPTY : TextUtil.getByteBuffer(end), ByteBuffer.wrap(IteratorUtil.encodeIteratorSettings(config.getIterators())), ByteBuffer.wrap(CompactionStrategyConfigUtil.encode(config.getCompactionStrategy())));
@Override protected void doTableOp(final Shell shellState, final String tableName) throws AccumuloException, AccumuloSecurityException { // compact the tables if (cancel) { try { shellState.getConnector().tableOperations().cancelCompaction(tableName); Shell.log.info("Compaction canceled for table " + tableName); } catch (TableNotFoundException e) { throw new AccumuloException(e); } } else { try { if (compactionConfig.getWait()) { Shell.log.info("Compacting table ..."); } for (IteratorSetting iteratorSetting : compactionConfig.getIterators()) { ScanCommand.ensureTserversCanLoadIterator(shellState, tableName, iteratorSetting.getIteratorClass()); } shellState.getConnector().tableOperations().compact(tableName, compactionConfig); Shell.log.info("Compaction of table " + tableName + " " + (compactionConfig.getWait() ? "completed" : "started") + " for given range"); } catch (Exception ex) { throw new AccumuloException(ex); } } }