Skip to content

Commit

Permalink
Rename raft log pruning setting to be consistent with kernel.
Browse files Browse the repository at this point in the history
The raft log pruning naming was the inverse of how it was named in
the kernel settings. This lead to logs to always be pruned rather than
never being pruned.
  • Loading branch information
Max Sumrall committed May 23, 2016
1 parent dd8bb6e commit 2904903
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 33 deletions.
@@ -0,0 +1,54 @@
/*
* Copyright (c) 2002-2016 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.kernel.impl.transaction.log.pruning;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.neo4j.kernel.impl.transaction.log.pruning.ThresholdConfigParser.ThresholdConfigValue;
import static org.neo4j.kernel.impl.transaction.log.pruning.ThresholdConfigParser.ThresholdConfigValue.NO_PRUNING;
import static org.neo4j.kernel.impl.transaction.log.pruning.ThresholdConfigParser.parse;

public class ThresholdConfigParserTest
{
@Test
public void parseTrue() throws Exception
{
ThresholdConfigValue aTrue = parse( "true" );
assertEquals( NO_PRUNING.type, aTrue.type );
assertEquals( NO_PRUNING.value, aTrue.value );
}

@Test
public void parseFalse() throws Exception
{
ThresholdConfigValue aFalse = parse( "false" );
assertEquals( "entries", aFalse.type );
assertEquals( 1, aFalse.value );
}

@Test(expected=IllegalArgumentException.class)
public void parseGarbage() throws Exception
{
parse( "davide" );
fail("Expected IllegalArgumentException");
}
}
Expand Up @@ -173,7 +173,7 @@ public String toString()


@Description( "RAFT log pruning strategy" ) @Description( "RAFT log pruning strategy" )
public static final Setting<String> raft_log_pruning = public static final Setting<String> raft_log_pruning =
setting( "core_edge.raft_log_pruning", STRING, "false" ); setting( "core_edge.keep_raft_logs", STRING, "true" );


@Description( "RAFT log implementation" ) @Description( "RAFT log implementation" )
public static final Setting<String> raft_log_implementation = public static final Setting<String> raft_log_implementation =
Expand Down
Expand Up @@ -26,7 +26,7 @@
public class NoPruningPruningStrategyTest public class NoPruningPruningStrategyTest
{ {
@Test @Test
public void shouldNotExludeAnySegmentPages() throws Exception public void shouldNotExcludeAnySegmentPages() throws Exception
{ {
NoPruningPruningStrategy strategy = new NoPruningPruningStrategy(); NoPruningPruningStrategy strategy = new NoPruningPruningStrategy();


Expand Down

This file was deleted.

0 comments on commit 2904903

Please sign in to comment.