code: func (c *CasIdx) Init() error {
  	log.Infof("initializing cassandra-idx. Hosts=%s", c.cfg.hosts)
  	if err := c.MemoryIndex.Init(); err != nil {
  		return err
  	}
  
  	if err := c.InitBare(); err != nil {
  		return err
  	}
  
  	if c.cfg.updateCassIdx {
  		c.wg.Add(c.cfg.numConns)
  		for i := 0; i < c.cfg.numConns; i++ {
  			go c.processWriteQueue()
  		}
  		log.Infof("cassandra-idx: started %d writeQueue handlers", c.cfg.numConns)
  	}
  
  	//Rebuild the in-memory index.
  	c.rebuildIndex()
  
  	if memory.IndexRules.Prunable() {
  		go c.prune()
  	}
  	return nil
  }
docs: // Init makes sure the needed keyspace, table, index in cassandra exists, creates the session,
  // rebuilds the in-memory index, sets up write queues, metrics and pruning routines