Sha256: 2bce8b860be537a959406ce4272549d4a573fa683ab162e4885438d266fbaff6

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

module Druid
  module Query
    module Datasource
      java_import org.apache.zookeeper.ZKUtil

      ZOOKEEPER_BEAMS_PATH = '/tranquility/beams/druid:overlord'.freeze

      delegate :datasource_enabled?,
               :datasource_info,
               :disable_datasource,
               :list_datasources,
               to: :coordinator

      def delete_datasource(datasource_name)
        shutdown_tasks(datasource_name)
        datasource_enabled?(datasource_name) ? disable_datasource(datasource_name) : true
        writer.remove_tranquilizer_for_datasource(datasource_name)
        delete_zookeeper_nodes(datasource_name) if config.strong_delete
      end

      def delete_datasources
        list_datasources.each{ |datasource_name| delete_datasource(datasource_name) }
      end

      private

      def delete_zookeeper_nodes(datasource_name)
        curator = Druid::Writer::Tranquilizer::Curator.build(config)
        curator.start
        zk = curator.getZookeeperClient.getZooKeeper
        ZKUtil.deleteRecursive(zk, ZOOKEEPER_BEAMS_PATH + "/#{datasource_name}")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jruby-druid-1.0.0.pre.rc2 lib/druid/query/datasource.rb