1 /*******************************************************************************
2 * Copyright (c) 2012, 2014 Ericsson
3 * Copyright (c) 2010, 2011 École Polytechnique de Montréal
4 * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
6 * All rights reserved. This program and the accompanying materials are
7 * made available under the terms of the Eclipse Public License v1.0 which
8 * accompanies this distribution, and is available at
9 * http://www.eclipse.org/legal/epl-v10.html
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.statesystem
.core
.backend
.historytree
;
18 * Configuration object for the {@link HistoryTree}.
20 * @author Alexandre Montplaisir
22 public final class HTConfig
{
24 private static final int DEFAULT_BLOCKSIZE
= 64 * 1024;
25 private static final int DEFAULT_MAXCHILDREN
= 50;
27 private final File stateFile
;
28 private final int blockSize
;
29 private final int maxChildren
;
30 private final int providerVersion
;
31 private final long treeStart
;
37 * The name of the history file
39 * The size of each "block" on disk. One node will always fit in
42 * The maximum number of children allowed per core (non-leaf)
44 * @param providerVersion
45 * The version of the state provider. If a file already exists,
46 * and their versions match, the history file will not be rebuilt
49 * The start time of the history
51 public HTConfig(File newStateFile
, int blockSize
, int maxChildren
,
52 int providerVersion
, long startTime
) {
53 this.stateFile
= newStateFile
;
54 this.blockSize
= blockSize
;
55 this.maxChildren
= maxChildren
;
56 this.providerVersion
= providerVersion
;
57 this.treeStart
= startTime
;
61 * Version of the constructor using default values for 'blockSize' and
65 * The name of the history file
66 * @param providerVersion
67 * The version of the state provider. If a file already exists,
68 * and their versions match, the history file will not be rebuilt
71 * The start time of the history
73 public HTConfig(File newStateFile
, int providerVersion
, long startTime
) {
74 this(newStateFile
, DEFAULT_BLOCKSIZE
, DEFAULT_MAXCHILDREN
, providerVersion
, startTime
);
77 // ------------------------------------------------------------------------
79 // ------------------------------------------------------------------------
82 * Get the history file.
84 * @return The history file
86 public File
getStateFile() {
91 * Get the configure block size.
93 * @return The block size
95 public int getBlockSize() {
100 * Get the maximum amount of children allowed.
102 * @return The maximum amount of children
104 public int getMaxChildren() {
109 * Get the state provider's version.
111 * @return The state provider's version
113 public int getProviderVersion() {
114 return providerVersion
;
118 * Get the start time of the history
120 * @return The start time
122 public long getTreeStart() {
This page took 0.084318 seconds and 5 git commands to generate.