anchor.diff:  %%--------------------------------------------------------------------
   start_link() ->
       gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
  -
  -create_bucket(Bucket) ->
  -    BucketConfigs = get_buckets(),
  -    case lists:keymember(Bucket, 1, BucketConfigs) of
  -        true ->
  -            {error, already_exists};
  -        false ->
  -            NewBucketConfig = new_bucket(Bucket, 4096, 2),
  -            ns_config:set(memcached, buckets, [NewBucketConfig|BucketConfigs])
  -    end.
   
   get_bucket(Bucket) ->
       BucketConfigs = get_buckets(),
  
positive.code: 
  %% API
  -export([start_link/0]).
  -export([create_bucket/1,
           get_bucket/1,
           get_buckets/0,
           get_bucket_names/0,
           set_bucket_config/2,
           set_map/2,
           new_bucket/3]).
  
  %% gen_server callbacks
  -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
  
negative.code:                       case lists:member(BucketName, CurBuckets) of
                            true -> ok;
                            false ->
                                ConfigString = config_string(BucketName, BucketConfig),
                                error_logger:info_msg(
                                  "~p:check_config(): activating bucket ~p with config ~p~n",
                                  [?MODULE, BucketName, ConfigString]),
                                ns_memcached:create_bucket(BucketName, ConfigString)
                        end
                end, BucketConfigs);
          _ -> ok
      end.
  
  config_string(BucketName, BucketConfig) ->
      DbName = case proplists:get_value(dbname, BucketConfig) of
                   undefined ->
                       DataDir = filename:join(ns_config_default:default_path("data"),
                                               misc:node_name_short()),
                       filename:join(DataDir, BucketName);
                   N -> N
               end,
      ok = filelib:ensure_dir(DbName),
      lists:flatten(io_lib:format("vb0=false;dbname=~s", [DbName])).
  