make optimize default parameters constants

This commit is contained in:
kimchy 2011-02-10 16:48:05 +02:00
parent 9ae9ab9553
commit 2e12e5b279
2 changed files with 18 additions and 10 deletions

View File

@ -43,15 +43,23 @@ import java.io.IOException;
*/
public class OptimizeRequest extends BroadcastOperationRequest {
private boolean waitForMerge = true;
public static final class Defaults {
public static final boolean WAIT_FOR_MERGE = true;
public static final int MAX_NUM_SEGMENTS = -1;
public static final boolean ONLY_EXPUNGE_DELETES = false;
public static final boolean FLUSH = true;
public static final boolean REFRESH = true;
}
private int maxNumSegments = -1;
private boolean waitForMerge = Defaults.WAIT_FOR_MERGE;
private boolean onlyExpungeDeletes = false;
private int maxNumSegments = Defaults.MAX_NUM_SEGMENTS;
private boolean flush = true;
private boolean onlyExpungeDeletes = Defaults.ONLY_EXPUNGE_DELETES;
private boolean refresh = true;
private boolean flush = Defaults.FLUSH;
private boolean refresh = Defaults.FLUSH;
/**
* Constructs an optimization request over one or more indices.

View File

@ -30,15 +30,15 @@ import java.io.IOException;
*/
class ShardOptimizeRequest extends BroadcastShardOperationRequest {
private boolean waitForMerge = true;
private boolean waitForMerge = OptimizeRequest.Defaults.WAIT_FOR_MERGE;
private int maxNumSegments = -1;
private int maxNumSegments = OptimizeRequest.Defaults.MAX_NUM_SEGMENTS;
private boolean onlyExpungeDeletes = false;
private boolean onlyExpungeDeletes = OptimizeRequest.Defaults.ONLY_EXPUNGE_DELETES;
private boolean flush = false;
private boolean flush = OptimizeRequest.Defaults.FLUSH;
private boolean refresh = false;
private boolean refresh = OptimizeRequest.Defaults.REFRESH;
ShardOptimizeRequest() {
}