anchor.diff:  -author('schintke@zib.de').
   -vsn('$Id:$ ').
   
  -%-define(TRACE(X,Y), io:format(X,Y)).
  +                                                %-define(TRACE(X,Y), io:format(X,Y)).
   -define(TRACE(X,Y), ok).
   -include("scalaris.hrl").
   -include("record_helpers.hrl").
  
positive.code:              io_lib:format("lease_db~p", ?RT:get_key_segment(Key, 4)))),
  
      rbrcseq:qwrite(DB, self(), Key,
                     fun l_on_cseq:is_valid_state_change/3,
                     Value),
      receive
          ?SCALARIS_RECV({qwrite_done, _ReqId, _Round, _Value}, {ok} ) %%;
  %%        ?SCALARIS_RECV({qwrite_deny, _ReqId, _Round, _Value}, {fail, timeout} )
      end.
  
  %% content checks
  -spec is_valid_state_change(any(), {prbr:write_filter(), any()}) ->
                                 {boolean(), null}.
  is_valid_state_change(rbr_bottom, {_WriteFilter, NewLease}) ->
      is_valid_creation(NewLease);
  is_valid_state_change(OldQRLease, {_WriteFilter, NewLease}) ->
      Result =
          case OldQRLease#lease.aux of
              {aux, empty} ->
                  is_valid_renewal(OldQRLease, NewLease)
                      orelse is_start_complex_op(OldQRLease, NewLease);
              %% {aux, {create, Parent}} ->
              %%     is_valid_create_step2(
              %%        andalso true,
  
negative.code:                                                 % @copyright 2012 Zuse Institute Berlin,
  
                                                  %   Licensed under the Apache License, Version 2.0 (the "License");
                                                  %   you may not use this file except in compliance with the License.
                                                  %   You may obtain a copy of the License at
                                                  %
                                                  %       http://www.apache.org/licenses/LICENSE-2.0
                                                  %
                                                  %   Unless required by applicable law or agreed to in writing, software
                                                  %   distributed under the License is distributed on an "AS IS" BASIS,
                                                  %   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
                                                  %   See the License for the specific language governing permissions and
                                                  %   limitations under the License.
  
  %% @author Florian Schintke <schintke@zib.de>
  %% @doc lease store based on rbrcseq.
  