class TrimObserver {

    public void onTrimConfigUpdated(@Observes @TrimConfigUpdated TrimConfig trimConfig) {
        log.info("Set trim to {} ", trimConfig.isEnableTrim());
        this.trimDerivedTablesEnabled = trimConfig.isEnableTrim();
        if (trimConfig.isClearTrimQueue()) {
            synchronized (lock) {
                trimHeights.clear();
            }
        }
    }

    @Inject public  TrimObserver(TrimService trimService, BlockchainConfig blockchainConfig,
                        PropertiesHolder propertiesHolder, Random random,
                        Blockchain blockchain);

}