anchor.diff:      State1 = State#state{estores = gb_trees:empty()},
       {reply, ok, State1};
   
  -handle_call({delete, Bucket}, _From,
  -             State = #state{dir = Dir}) ->
  +handle_call({delete, Bucket}, _From, State) ->
       {R, State1} = case get_set(Bucket, State) of
                         {ok, {EStore, S1}} ->
                             estore:delete(EStore),
  -                          file:del_dir([Dir, $/, Bucket]),
  +                          file:del_dir(bucket_dir(Bucket, State)),
                             Estore = gb_trees:delete(Bucket, S1#state.estores),
                             {ok, S1#state{estores = Estore}};
                         _ ->
  
positive.code:             {reply, empty, State}
      end;
  
  handle_call(delete, _From, State = #state{dir = PartitionDir}) ->
      lager:warning("[event] deleting io node: ~s.", [PartitionDir]),
      gb_trees:map(fun(Bucket, EStore) ->
                           lager:warning("[event] deleting bucket: ~s.",
                                         [Bucket]),
                           estore:delete(EStore),
                           file:del_dir([PartitionDir, $/, Bucket])
                   end, State#state.estores),
      case list_buckets(State) of
          {ok, Buckets} ->
              [case estore:open([PartitionDir, $/, B], [no_index]) of
                   {ok, Store}  ->
                       lager:warning("[event] deleting bucket: ~s.",
                                     [B]),
                       estore:delete(Store),
                       file:del_dir([PartitionDir, $/, B]);
                   {error, enoent} ->
                       lager:warning("[event] deleting (empty) bucket: ~s.",
                                     [B]),
                       file:del_dir([PartitionDir, $/, B])
               end || B <- Buckets];
          _ ->
              ok
  
negative.code:         {ok, R} ->
              R;
          {error, not_found} ->
              EStore = new_store(Bucket, State),
              Store1 = gb_trees:insert(Bucket, EStore, Store),
              {EStore, State#state{estores = Store1}}
      end.
  
  bucket_exists(Bucket, State) ->
      BucketDir = bucket_dir(Bucket, State),
      filelib:is_dir(BucketDir).
  
  -spec do_write(binary(), [efile:event()], state()) ->
  