anchor.diff:  %% -------------------------------------------------------------------
   %%
  -%% riak_kv_ts_watcher: Polls for completion of DDL activities for bucket
  +%% riak_kv_ts_watch_fsm: Polls for completion of DDL activities for bucket
   %% type activation
   %%
   %% Copyright (c) 2015 Basho Technologies, Inc.  All Rights Reserved.
  
positive.code:             %% Assume a race condition we can ignore. Maybe.
              ok
      end;
  %% Can be success or failure; we don't care which. Tuple with result
  %% code and whatever useful message the compilation process can
  %% provide
  compiling(Completion, #state{supervisor=Sup}=State) ->
      notify_supervisor(Sup, Completion),
      {stop, Completion, State#state{compiler=undefined}}.
  
  %% This is used strictly when we're ready to stop
  notify_supervisor(Supervisor, Status) ->
      gen_server:cast(Supervisor, Status).
  
  
negative.code: -include_lib("riak_core/include/riak_core_bucket_type.hrl").
  
  %% API
  -export([start_link/3, waiting/2, compiling/2, compiled/2, failed/2]).
  
  %% gen_fsm callbacks
  -export([init/1, handle_event/3,
           handle_sync_event/4, handle_info/3, terminate/3, code_change/4]).
  
  -define(SERVER, ?MODULE).
  
   %% How long to wait for cluster metadata to propagate on startup
  -define(CMD_RETRY, 2000).
  
   %% How long to wait for the compilation mechanism to succeed before
   %% giving up.
  -define(COMPILE_WAIT, 30000).
  
  %% How long to wait for a new DDL or bucket type activation after the
  %% compile finishes. Should be longer in production, but useful to
  %% keep this short during development
  -define(CMD_UPDATE, 6000).
  
  -record(state, {
            compiler_mod :: atom(),
            bucket_type :: binary(),
            supervisor :: pid(),
            ddl = undefined :: term(),
            compiler = undefined :: 'undefined' | pid(),
            beam_dir :: file:filename(), %% Path to location to store beams
            beam_file :: file:filename() %% Full path to compiled beam when complete
           }).
  
  
  