Search in sources :

Example 1 with CompactionDispatcher

use of org.apache.accumulo.core.spi.compaction.CompactionDispatcher in project accumulo by apache.

the class TableConfiguration method createCompactionDispatcher.

private static CompactionDispatcher createCompactionDispatcher(AccumuloConfiguration conf, ServerContext context, TableId tableId) {
    CompactionDispatcher newDispatcher = Property.createTableInstanceFromPropertyName(conf, Property.TABLE_COMPACTION_DISPATCHER, CompactionDispatcher.class, null);
    Map<String, String> opts = conf.getAllPropertiesWithPrefixStripped(Property.TABLE_COMPACTION_DISPATCHER_OPTS);
    newDispatcher.init(new CompactionDispatcher.InitParameters() {

        private final ServiceEnvironment senv = new ServiceEnvironmentImpl(context);

        @Override
        public TableId getTableId() {
            return tableId;
        }

        @Override
        public Map<String, String> getOptions() {
            return opts;
        }

        @Override
        public ServiceEnvironment getServiceEnv() {
            return senv;
        }
    });
    return newDispatcher;
}
Also used : TableId(org.apache.accumulo.core.data.TableId) CompactionDispatcher(org.apache.accumulo.core.spi.compaction.CompactionDispatcher) ServiceEnvironment(org.apache.accumulo.core.spi.common.ServiceEnvironment) ServiceEnvironmentImpl(org.apache.accumulo.server.ServiceEnvironmentImpl) HashMap(java.util.HashMap) Map(java.util.Map) EnumMap(java.util.EnumMap)

Aggregations

EnumMap (java.util.EnumMap)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 TableId (org.apache.accumulo.core.data.TableId)1 ServiceEnvironment (org.apache.accumulo.core.spi.common.ServiceEnvironment)1 CompactionDispatcher (org.apache.accumulo.core.spi.compaction.CompactionDispatcher)1 ServiceEnvironmentImpl (org.apache.accumulo.server.ServiceEnvironmentImpl)1