tidy out io:format

This commit is contained in:
martinsumner 2017-03-10 11:10:15 +00:00
parent 601f43de3d
commit 730ab2ec48

View file

@ -414,7 +414,6 @@ fetch(LedgerKey, Hash, State) ->
State#state.blockindex_cache), State#state.blockindex_cache),
case CachedBlockIdx of case CachedBlockIdx of
none -> none ->
io:format("Looking for key without cache~n"),
SlotBin = read_slot(State#state.handle, Slot), SlotBin = read_slot(State#state.handle, Slot),
{Result, {Result,
BlockLengths, BlockLengths,
@ -428,7 +427,6 @@ fetch(LedgerKey, Hash, State) ->
Slot#slot_index_value.slot_id, Slot#slot_index_value.slot_id,
State#state{blockindex_cache = BlockIndexCache}}; State#state{blockindex_cache = BlockIndexCache}};
<<BlockLengths:20/binary, BlockIdx/binary>> -> <<BlockLengths:20/binary, BlockIdx/binary>> ->
io:format("Looking for key with cache~n"),
PosList = find_pos(BlockIdx, PosList = find_pos(BlockIdx,
double_hash(Hash, LedgerKey), double_hash(Hash, LedgerKey),
[], [],
@ -800,14 +798,11 @@ check_blocks([], _Handle, _Slot, _BlockLengths, _LedgerKey) ->
not_present; not_present;
check_blocks([Pos|Rest], Handle, Slot, BlockLengths, LedgerKey) -> check_blocks([Pos|Rest], Handle, Slot, BlockLengths, LedgerKey) ->
{BlockNumber, BlockPos} = revert_position(Pos), {BlockNumber, BlockPos} = revert_position(Pos),
io:format("Checking BlockNumber ~w in BlockPos ~w~n",
[BlockNumber, BlockPos]),
BlockBin = read_block(Handle, Slot, BlockLengths, BlockNumber), BlockBin = read_block(Handle, Slot, BlockLengths, BlockNumber),
BlockL = binary_to_term(BlockBin), BlockL = binary_to_term(BlockBin),
{K, V} = lists:nth(BlockPos, BlockL), {K, V} = lists:nth(BlockPos, BlockL),
case K of case K of
LedgerKey -> LedgerKey ->
io:format("Key mismatch in check_blocks~n"),
{K, V}; {K, V};
_ -> _ ->
check_blocks(Rest, Handle, Slot, BlockLengths, LedgerKey) check_blocks(Rest, Handle, Slot, BlockLengths, LedgerKey)
@ -816,7 +811,6 @@ check_blocks([Pos|Rest], Handle, Slot, BlockLengths, LedgerKey) ->
read_block(Handle, Slot, BlockLengths, BlockID) -> read_block(Handle, Slot, BlockLengths, BlockID) ->
{BlockPos, Offset, Length} = block_offsetandlength(BlockLengths, BlockID), {BlockPos, Offset, Length} = block_offsetandlength(BlockLengths, BlockID),
io:format("Reading offset ~w Length ~w~n", [Offset, Length]),
{ok, BlockBin} = file:pread(Handle, {ok, BlockBin} = file:pread(Handle,
Slot#slot_index_value.start_position Slot#slot_index_value.start_position
+ BlockPos + BlockPos
@ -1058,7 +1052,6 @@ fetch_value([Pos|Rest], BlockLengths, Blocks, Key) ->
{K, V} = lists:nth(BlockPos, BlockL), {K, V} = lists:nth(BlockPos, BlockL),
case K of case K of
Key -> Key ->
io:format("Key mismatch in fetch_value~n"),
{K, V}; {K, V};
_ -> _ ->
fetch_value(Rest, BlockLengths, Blocks, Key) fetch_value(Rest, BlockLengths, Blocks, Key)