1 /*******************************************************************************
2 * Copyright (c) 2010, 2016 Ericsson, École Polytechnique de Montréal, and others
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Alexandre Montplaisir - Initial API and implementation
11 * Florian Wininger - Add Extension and Leaf Node
12 * Patrick Tasse - Add message to exceptions
13 *******************************************************************************/
15 package org
.eclipse
.tracecompass
.internal
.statesystem
.core
.backend
.historytree
;
18 import java
.io
.FileInputStream
;
19 import java
.io
.IOException
;
20 import java
.io
.PrintWriter
;
21 import java
.nio
.ByteBuffer
;
22 import java
.nio
.ByteOrder
;
23 import java
.nio
.channels
.ClosedChannelException
;
24 import java
.nio
.channels
.FileChannel
;
25 import java
.util
.ArrayList
;
26 import java
.util
.Collections
;
27 import java
.util
.List
;
29 import org
.eclipse
.jdt
.annotation
.NonNull
;
30 import org
.eclipse
.tracecompass
.internal
.statesystem
.core
.Activator
;
31 import org
.eclipse
.tracecompass
.statesystem
.core
.ITmfStateSystemBuilder
;
32 import org
.eclipse
.tracecompass
.statesystem
.core
.exceptions
.TimeRangeException
;
34 import com
.google
.common
.collect
.ImmutableList
;
37 * Meta-container for the History Tree. This structure contains all the
38 * high-level data relevant to the tree.
40 * @author Alexandre Montplaisir
42 public class HistoryTree
{
45 * Size of the "tree header" in the tree-file The nodes will use this offset
46 * to know where they should be in the file. This should always be a
49 public static final int TREE_HEADER_SIZE
= 4096;
51 private static final int HISTORY_FILE_MAGIC_NUMBER
= 0x05FFA900;
53 /** File format version. Increment when breaking compatibility. */
54 private static final int FILE_VERSION
= 6;
56 // ------------------------------------------------------------------------
57 // Tree-specific configuration
58 // ------------------------------------------------------------------------
60 /** Container for all the configuration constants */
61 private final HTConfig fConfig
;
63 /** Reader/writer object */
64 private final HT_IO fTreeIO
;
66 // ------------------------------------------------------------------------
67 // Variable Fields (will change throughout the existence of the SHT)
68 // ------------------------------------------------------------------------
70 /** Latest timestamp found in the tree (at any given moment) */
71 private long fTreeEnd
;
73 /** The total number of nodes that exists in this tree */
74 private int fNodeCount
;
76 /** "Cache" to keep the active nodes in memory */
77 private final @NonNull List
<@NonNull HTNode
> fLatestBranch
;
79 // ------------------------------------------------------------------------
80 // Constructors/"Destructors"
81 // ------------------------------------------------------------------------
84 * Create a new State History from scratch, using a {@link HTConfig} object
88 * The config to use for this History Tree.
90 * If an error happens trying to open/write to the file
91 * specified in the config
93 public HistoryTree(HTConfig conf
) throws IOException
{
95 * Simple check to make sure we have enough place in the 0th block for
96 * the tree configuration
98 if (conf
.getBlockSize() < TREE_HEADER_SIZE
) {
99 throw new IllegalArgumentException();
103 fTreeEnd
= conf
.getTreeStart();
105 fLatestBranch
= Collections
.synchronizedList(new ArrayList
<>());
107 /* Prepare the IO object */
108 fTreeIO
= new HT_IO(fConfig
, true);
110 /* Add the first node to the tree */
111 LeafNode firstNode
= initNewLeafNode(-1, conf
.getTreeStart());
112 fLatestBranch
.add(firstNode
);
116 * "Reader" constructor : instantiate a SHTree from an existing tree file on
119 * @param existingStateFile
120 * Path/filename of the history-file we are to open
121 * @param expProviderVersion
122 * The expected version of the state provider
123 * @throws IOException
124 * If an error happens reading the file
126 public HistoryTree(File existingStateFile
, int expProviderVersion
) throws IOException
{
128 * Open the file ourselves, get the tree header information we need,
129 * then pass on the descriptor to the TreeIO object.
131 int rootNodeSeqNb
, res
;
135 /* Java I/O mumbo jumbo... */
136 if (!existingStateFile
.exists()) {
137 throw new IOException("Selected state file does not exist"); //$NON-NLS-1$
139 if (existingStateFile
.length() <= 0) {
140 throw new IOException("Empty target file"); //$NON-NLS-1$
143 try (FileInputStream fis
= new FileInputStream(existingStateFile
);
144 FileChannel fc
= fis
.getChannel();) {
146 ByteBuffer buffer
= ByteBuffer
.allocate(TREE_HEADER_SIZE
);
148 buffer
.order(ByteOrder
.LITTLE_ENDIAN
);
154 * Check the magic number to make sure we're opening the right type
157 res
= buffer
.getInt();
158 if (res
!= HISTORY_FILE_MAGIC_NUMBER
) {
159 throw new IOException("Wrong magic number"); //$NON-NLS-1$
162 res
= buffer
.getInt(); /* File format version number */
163 if (res
!= FILE_VERSION
) {
164 throw new IOException("Mismatching History Tree file format versions"); //$NON-NLS-1$
167 res
= buffer
.getInt(); /* Event handler's version number */
168 if (res
!= expProviderVersion
&&
169 expProviderVersion
!= ITmfStateSystemBuilder
.IGNORE_PROVIDER_VERSION
) {
171 * The existing history was built using an event handler that
172 * doesn't match the current one in the framework.
174 * Information could be all wrong. Instead of keeping an
175 * incorrect history file, a rebuild is done.
177 throw new IOException("Mismatching event handler versions"); //$NON-NLS-1$
180 bs
= buffer
.getInt(); /* Block Size */
181 maxc
= buffer
.getInt(); /* Max nb of children per node */
183 fNodeCount
= buffer
.getInt();
184 rootNodeSeqNb
= buffer
.getInt();
185 startTime
= buffer
.getLong();
187 fConfig
= new HTConfig(existingStateFile
, bs
, maxc
, expProviderVersion
, startTime
);
191 * FIXME We close fis here and the TreeIO will then reopen the same
192 * file, not extremely elegant. But how to pass the information here to
195 fTreeIO
= new HT_IO(fConfig
, false);
197 fLatestBranch
= buildLatestBranch(rootNodeSeqNb
);
198 fTreeEnd
= getRootNode().getNodeEnd();
201 * Make sure the history start time we read previously is consistent
202 * with was is actually in the root node.
204 if (startTime
!= getRootNode().getNodeStart()) {
205 throw new IOException("Inconsistent start times in the" + //$NON-NLS-1$
206 "history file, it might be corrupted."); //$NON-NLS-1$
211 * Rebuild the latestBranch "cache" object by reading the nodes from disk
212 * (When we are opening an existing file on disk and want to append to it,
215 * @param rootNodeSeqNb
216 * The sequence number of the root node, so we know where to
218 * @throws ClosedChannelException
220 private @NonNull List
<@NonNull HTNode
> buildLatestBranch(int rootNodeSeqNb
) throws ClosedChannelException
{
221 List
<@NonNull HTNode
> list
= new ArrayList
<>();
223 HTNode nextChildNode
= fTreeIO
.readNode(rootNodeSeqNb
);
224 list
.add(nextChildNode
);
226 /* Follow the last branch up to the leaf */
227 while (nextChildNode
.getNodeType() == HTNode
.NodeType
.CORE
) {
228 nextChildNode
= fTreeIO
.readNode(((CoreNode
) nextChildNode
).getLatestChild());
229 list
.add(nextChildNode
);
231 return Collections
.synchronizedList(list
);
235 * "Save" the tree to disk. This method will cause the treeIO object to
236 * commit all nodes to disk and then return the RandomAccessFile descriptor
237 * so the Tree object can save its configuration into the header of the
240 * @param requestedEndTime
241 * The greatest timestamp present in the history tree
243 public void closeTree(long requestedEndTime
) {
244 /* This is an important operation, queries can wait */
245 synchronized (fLatestBranch
) {
247 * Work-around the "empty branches" that get created when the root
248 * node becomes full. Overwrite the tree's end time with the
249 * original wanted end-time, to ensure no queries are sent into
252 * This won't be needed once extended nodes are implemented.
254 fTreeEnd
= requestedEndTime
;
256 /* Close off the latest branch of the tree */
257 for (int i
= 0; i
< fLatestBranch
.size(); i
++) {
258 fLatestBranch
.get(i
).closeThisNode(fTreeEnd
);
259 fTreeIO
.writeNode(fLatestBranch
.get(i
));
262 try (FileChannel fc
= fTreeIO
.getFcOut();) {
263 ByteBuffer buffer
= ByteBuffer
.allocate(TREE_HEADER_SIZE
);
264 buffer
.order(ByteOrder
.LITTLE_ENDIAN
);
267 /* Save the config of the tree to the header of the file */
270 buffer
.putInt(HISTORY_FILE_MAGIC_NUMBER
);
272 buffer
.putInt(FILE_VERSION
);
273 buffer
.putInt(fConfig
.getProviderVersion());
275 buffer
.putInt(fConfig
.getBlockSize());
276 buffer
.putInt(fConfig
.getMaxChildren());
278 buffer
.putInt(fNodeCount
);
280 /* root node seq. nb */
281 buffer
.putInt(fLatestBranch
.get(0).getSequenceNumber());
283 /* start time of this history */
284 buffer
.putLong(fLatestBranch
.get(0).getNodeStart());
287 int res
= fc
.write(buffer
);
288 assert (res
<= TREE_HEADER_SIZE
);
289 /* done writing the file header */
291 } catch (IOException e
) {
293 * If we were able to write so far, there should not be any
294 * problem at this point...
296 throw new RuntimeException("State system write error"); //$NON-NLS-1$
301 // ------------------------------------------------------------------------
303 // ------------------------------------------------------------------------
306 * Get the start time of this tree.
308 * @return The start time
310 public long getTreeStart() {
311 return fConfig
.getTreeStart();
315 * Get the current end time of this tree.
317 * @return The end time
319 public long getTreeEnd() {
324 * Get the number of nodes in this tree.
326 * @return The number of nodes
328 public int getNodeCount() {
333 * Get the current root node of this tree
335 * @return The root node
337 public HTNode
getRootNode() {
338 return fLatestBranch
.get(0);
342 * Return the latest branch of the tree. That branch is immutable. Used for
343 * unit testing and debugging.
345 * @return The immutable latest branch
347 protected List
<@NonNull HTNode
> getLatestBranch() {
348 return ImmutableList
.copyOf(fLatestBranch
);
351 // ------------------------------------------------------------------------
353 // ------------------------------------------------------------------------
356 * Return the FileInputStream reader with which we will read an attribute
357 * tree (it will be sought to the correct position).
359 * @return The FileInputStream indicating the file and position from which
360 * the attribute tree can be read.
362 public FileInputStream
supplyATReader() {
363 return fTreeIO
.supplyATReader(getNodeCount());
367 * Return the file to which we will write the attribute tree.
369 * @return The file to which we will write the attribute tree
371 public File
supplyATWriterFile() {
372 return fConfig
.getStateFile();
376 * Return the position in the file (given by {@link #supplyATWriterFile})
377 * where to start writing the attribute tree.
379 * @return The position in the file where to start writing
381 public long supplyATWriterFilePos() {
382 return HistoryTree
.TREE_HEADER_SIZE
383 + ((long) getNodeCount() * fConfig
.getBlockSize());
387 * Read a node from the tree.
390 * The sequence number of the node to read
392 * @throws ClosedChannelException
393 * If the tree IO is unavailable
395 public HTNode
readNode(int seqNumber
) throws ClosedChannelException
{
396 /* Try to read the node from memory */
397 synchronized (fLatestBranch
) {
398 for (HTNode node
: fLatestBranch
) {
399 if (node
.getSequenceNumber() == seqNumber
) {
405 /* Read the node from disk */
406 return fTreeIO
.readNode(seqNumber
);
410 * Write a node object to the history file.
413 * The node to write to disk
415 public void writeNode(HTNode node
) {
416 fTreeIO
.writeNode(node
);
420 * Close the history file.
422 public void closeFile() {
427 * Delete the history file.
429 public void deleteFile() {
430 fTreeIO
.deleteFile();
433 // ------------------------------------------------------------------------
435 // ------------------------------------------------------------------------
438 * Insert an interval in the tree.
441 * The interval to be inserted
442 * @throws TimeRangeException
443 * If the start of end time of the interval are invalid
445 public void insertInterval(HTInterval interval
) throws TimeRangeException
{
446 if (interval
.getStartTime() < fConfig
.getTreeStart()) {
447 throw new TimeRangeException("Interval Start:" + interval
.getStartTime() + ", Config Start:" + fConfig
.getTreeStart()); //$NON-NLS-1$ //$NON-NLS-2$
449 tryInsertAtNode(interval
, fLatestBranch
.size() - 1);
453 * Inner method to find in which node we should add the interval.
456 * The interval to add to the tree
458 * The index *in the latestBranch* where we are trying the
461 private void tryInsertAtNode(HTInterval interval
, int indexOfNode
) {
462 HTNode targetNode
= fLatestBranch
.get(indexOfNode
);
464 /* Verify if there is enough room in this node to store this interval */
465 if (interval
.getSizeOnDisk() > targetNode
.getNodeFreeSpace()) {
466 /* Nope, not enough room. Insert in a new sibling instead. */
467 addSiblingNode(indexOfNode
);
468 tryInsertAtNode(interval
, fLatestBranch
.size() - 1);
472 /* Make sure the interval time range fits this node */
473 if (interval
.getStartTime() < targetNode
.getNodeStart()) {
475 * No, this interval starts before the startTime of this node. We
476 * need to check recursively in parents if it can fit.
478 tryInsertAtNode(interval
, indexOfNode
- 1);
483 * Ok, there is room, and the interval fits in this time slot. Let's add
486 targetNode
.addInterval(interval
);
488 /* Update treeEnd if needed */
489 if (interval
.getEndTime() > fTreeEnd
) {
490 fTreeEnd
= interval
.getEndTime();
495 * Method to add a sibling to any node in the latest branch. This will add
496 * children back down to the leaf level, if needed.
499 * The index in latestBranch where we start adding
501 private void addSiblingNode(int indexOfNode
) {
502 synchronized (fLatestBranch
) {
503 final long splitTime
= fTreeEnd
;
505 if (indexOfNode
>= fLatestBranch
.size()) {
507 * We need to make sure (indexOfNode - 1) doesn't get the last
508 * node in the branch, because that one is a Leaf Node.
510 throw new IllegalStateException();
513 /* Check if we need to add a new root node */
514 if (indexOfNode
== 0) {
519 /* Check if we can indeed add a child to the target parent */
520 if (((CoreNode
) fLatestBranch
.get(indexOfNode
- 1)).getNbChildren() == fConfig
.getMaxChildren()) {
521 /* If not, add a branch starting one level higher instead */
522 addSiblingNode(indexOfNode
- 1);
526 /* Split off the new branch from the old one */
527 for (int i
= indexOfNode
; i
< fLatestBranch
.size(); i
++) {
528 fLatestBranch
.get(i
).closeThisNode(splitTime
);
529 fTreeIO
.writeNode(fLatestBranch
.get(i
));
531 CoreNode prevNode
= (CoreNode
) fLatestBranch
.get(i
- 1);
534 switch (fLatestBranch
.get(i
).getNodeType()) {
536 newNode
= initNewCoreNode(prevNode
.getSequenceNumber(), splitTime
+ 1);
539 newNode
= initNewLeafNode(prevNode
.getSequenceNumber(), splitTime
+ 1);
542 throw new IllegalStateException();
545 prevNode
.linkNewChild(newNode
);
546 fLatestBranch
.set(i
, newNode
);
552 * Similar to the previous method, except here we rebuild a completely new
555 private void addNewRootNode() {
556 final long splitTime
= fTreeEnd
;
558 HTNode oldRootNode
= fLatestBranch
.get(0);
559 CoreNode newRootNode
= initNewCoreNode(-1, fConfig
.getTreeStart());
561 /* Tell the old root node that it isn't root anymore */
562 oldRootNode
.setParentSequenceNumber(newRootNode
.getSequenceNumber());
564 /* Close off the whole current latestBranch */
566 for (int i
= 0; i
< fLatestBranch
.size(); i
++) {
567 fLatestBranch
.get(i
).closeThisNode(splitTime
);
568 fTreeIO
.writeNode(fLatestBranch
.get(i
));
571 /* Link the new root to its first child (the previous root node) */
572 newRootNode
.linkNewChild(oldRootNode
);
574 /* Rebuild a new latestBranch */
575 int depth
= fLatestBranch
.size();
576 fLatestBranch
.clear();
577 fLatestBranch
.add(newRootNode
);
579 // Create new coreNode
580 for (int i
= 1; i
< depth
; i
++) {
581 CoreNode prevNode
= (CoreNode
) fLatestBranch
.get(i
- 1);
582 CoreNode newNode
= initNewCoreNode(prevNode
.getSequenceNumber(),
584 prevNode
.linkNewChild(newNode
);
585 fLatestBranch
.add(newNode
);
588 // Create the new leafNode
589 CoreNode prevNode
= (CoreNode
) fLatestBranch
.get(depth
- 1);
590 LeafNode newNode
= initNewLeafNode(prevNode
.getSequenceNumber(), splitTime
+ 1);
591 prevNode
.linkNewChild(newNode
);
592 fLatestBranch
.add(newNode
);
596 * Add a new empty core node to the tree.
598 * @param parentSeqNumber
599 * Sequence number of this node's parent
601 * Start time of the new node
602 * @return The newly created node
604 private @NonNull CoreNode
initNewCoreNode(int parentSeqNumber
, long startTime
) {
605 CoreNode newNode
= new CoreNode(fConfig
, fNodeCount
, parentSeqNumber
,
612 * Add a new empty leaf node to the tree.
614 * @param parentSeqNumber
615 * Sequence number of this node's parent
617 * Start time of the new node
618 * @return The newly created node
620 private @NonNull LeafNode
initNewLeafNode(int parentSeqNumber
, long startTime
) {
621 LeafNode newNode
= new LeafNode(fConfig
, fNodeCount
, parentSeqNumber
,
628 * Inner method to select the next child of the current node intersecting
629 * the given timestamp. Useful for moving down the tree following one
633 * The node on which the request is made
635 * The timestamp to choose which child is the next one
636 * @return The child node intersecting t
637 * @throws ClosedChannelException
638 * If the file channel was closed while we were reading the tree
640 public HTNode
selectNextChild(CoreNode currentNode
, long t
) throws ClosedChannelException
{
641 assert (currentNode
.getNbChildren() > 0);
642 int potentialNextSeqNb
= currentNode
.getSequenceNumber();
644 for (int i
= 0; i
< currentNode
.getNbChildren(); i
++) {
645 if (t
>= currentNode
.getChildStart(i
)) {
646 potentialNextSeqNb
= currentNode
.getChild(i
);
653 * Once we exit this loop, we should have found a children to follow. If
654 * we didn't, there's a problem.
656 if (potentialNextSeqNb
== currentNode
.getSequenceNumber()) {
657 throw new IllegalStateException("No next child node found"); //$NON-NLS-1$
661 * Since this code path is quite performance-critical, avoid iterating
662 * through the whole latestBranch array if we know for sure the next
663 * node has to be on disk
665 if (currentNode
.isOnDisk()) {
666 return fTreeIO
.readNode(potentialNextSeqNb
);
668 return readNode(potentialNextSeqNb
);
672 * Get the current size of the history file.
674 * @return The history file size
676 public long getFileSize() {
677 return fConfig
.getStateFile().length();
680 // ------------------------------------------------------------------------
681 // Test/debugging methods
682 // ------------------------------------------------------------------------
685 * Debugging method to make sure all intervals contained in the given node
686 * have valid start and end times.
690 * @return True if everything is fine, false if there is at least one
691 * invalid timestamp (end time < start time, time outside of the
692 * range of the node, etc.)
694 @SuppressWarnings("nls")
695 public boolean checkNodeIntegrity(HTNode zenode
) {
696 /* Only used for debugging, shouldn't be externalized */
699 StringBuffer buf
= new StringBuffer();
702 // FIXME /* Only testing Core Nodes for now */
703 if (!(zenode
instanceof CoreNode
)) {
707 node
= (CoreNode
) zenode
;
711 * Test that this node's start and end times match the start of the
712 * first child and the end of the last child, respectively
714 if (node
.getNbChildren() > 0) {
715 otherNode
= fTreeIO
.readNode(node
.getChild(0));
716 if (node
.getNodeStart() != otherNode
.getNodeStart()) {
717 buf
.append("Start time of node (" + node
.getNodeStart() + ") "
718 + "does not match start time of first child " + "("
719 + otherNode
.getNodeStart() + "), " + "node #"
720 + otherNode
.getSequenceNumber() + ")\n");
723 if (node
.isOnDisk()) {
724 otherNode
= fTreeIO
.readNode(node
.getLatestChild());
725 if (node
.getNodeEnd() != otherNode
.getNodeEnd()) {
726 buf
.append("End time of node (" + node
.getNodeEnd()
727 + ") does not match end time of last child ("
728 + otherNode
.getNodeEnd() + ", node #"
729 + otherNode
.getSequenceNumber() + ")\n");
736 * Test that the childStartTimes[] array matches the real nodes'
739 for (int i
= 0; i
< node
.getNbChildren(); i
++) {
740 otherNode
= fTreeIO
.readNode(node
.getChild(i
));
741 if (otherNode
.getNodeStart() != node
.getChildStart(i
)) {
742 buf
.append(" Expected start time of child node #"
743 + node
.getChild(i
) + ": " + node
.getChildStart(i
)
744 + "\n" + " Actual start time of node #"
745 + otherNode
.getSequenceNumber() + ": "
746 + otherNode
.getNodeStart() + "\n");
751 } catch (ClosedChannelException e
) {
752 Activator
.getDefault().logError(e
.getMessage(), e
);
756 Activator
.getDefault().logError("SHT: Integrity check failed for node #"
757 + node
.getSequenceNumber() + ":" + buf
.toString());
763 * Check the integrity of all the nodes in the tree. Calls
764 * {@link #checkNodeIntegrity} for every node in the tree.
766 public void checkIntegrity() {
768 for (int i
= 0; i
< fNodeCount
; i
++) {
769 checkNodeIntegrity(fTreeIO
.readNode(i
));
771 } catch (ClosedChannelException e
) {
775 /* Only used for debugging, shouldn't be externalized */
776 @SuppressWarnings("nls")
778 public String
toString() {
779 return "Information on the current tree:\n\n" + "Blocksize: "
780 + fConfig
.getBlockSize() + "\n" + "Max nb. of children per node: "
781 + fConfig
.getMaxChildren() + "\n" + "Number of nodes: " + fNodeCount
782 + "\n" + "Depth of the tree: " + fLatestBranch
.size() + "\n"
783 + "Size of the treefile: " + getFileSize() + "\n"
784 + "Root node has sequence number: "
785 + fLatestBranch
.get(0).getSequenceNumber() + "\n"
786 + "'Latest leaf' has sequence number: "
787 + fLatestBranch
.get(fLatestBranch
.size() - 1).getSequenceNumber();
791 * Start at currentNode and print the contents of all its children, in
792 * pre-order. Give the root node in parameter to visit the whole tree, and
793 * have a nice overview.
795 /* Only used for debugging, shouldn't be externalized */
796 @SuppressWarnings("nls")
797 private void preOrderPrint(PrintWriter writer
, boolean printIntervals
,
798 HTNode currentNode
, int curDepth
) {
800 writer
.println(currentNode
.toString());
801 if (printIntervals
) {
802 currentNode
.debugPrintIntervals(writer
);
805 switch (currentNode
.getNodeType()) {
807 /* Stop if it's the leaf node */
812 final CoreNode node
= (CoreNode
) currentNode
;
813 /* Print the extensions, if any */
814 int extension
= node
.getExtensionSequenceNumber();
815 while (extension
!= -1) {
816 HTNode nextNode
= fTreeIO
.readNode(extension
);
817 preOrderPrint(writer
, printIntervals
, nextNode
, curDepth
);
820 /* Print the child nodes */
821 for (int i
= 0; i
< node
.getNbChildren(); i
++) {
822 HTNode nextNode
= fTreeIO
.readNode(node
.getChild(i
));
823 for (int j
= 0; j
< curDepth
; j
++) {
827 preOrderPrint(writer
, printIntervals
, nextNode
, curDepth
+ 1);
829 } catch (ClosedChannelException e
) {
830 Activator
.getDefault().logError(e
.getMessage());
840 * Print out the full tree for debugging purposes
843 * PrintWriter in which to write the output
844 * @param printIntervals
845 * Flag to enable full output of the interval information
847 public void debugPrintFullTree(PrintWriter writer
, boolean printIntervals
) {
848 /* Only used for debugging, shouldn't be externalized */
850 preOrderPrint(writer
, false, fLatestBranch
.get(0), 0);
852 if (printIntervals
) {
853 writer
.println("\nDetails of intervals:"); //$NON-NLS-1$
854 preOrderPrint(writer
, true, fLatestBranch
.get(0), 0);
856 writer
.println('\n');