In BTree, if it is disposed (file is null), return -1 (insertion point
0) in the binary search. This will correspond to checkpoint 0 in the
flat array.
In FlatArray, if it is disposed (file is null) return null as checkpoint
in get(long).
In TmfCheckpointIndexer, if the returned checkpoint is null in
restoreCheckpoint(long), return the context given by the trace
implementation of seekEvent((ITmfLocation) null). It should properly
handle a disposed trace.
Change-Id: I3148d2e10118628e387d206054de55d5238a9807
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/74474
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
/*******************************************************************************
/*******************************************************************************
- * Copyright (c) 2013, 2014 Ericsson
+ * Copyright (c) 2013, 2016 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
private void accept(long nodeOffset, IBTreeVisitor visitor) {
private void accept(long nodeOffset, IBTreeVisitor visitor) {
- if (nodeOffset == BTreeNode.NULL_CHILD) {
+ if (nodeOffset == BTreeNode.NULL_CHILD || getRandomAccessFile() == null) {
/*******************************************************************************
/*******************************************************************************
- * Copyright (c) 2013, 2014 Ericsson
+ * Copyright (c) 2013, 2016 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
ITmfCheckpoint checkpoint = null;
try {
long pos = getHeader().getSize() + fCheckpointSize * rank;
ITmfCheckpoint checkpoint = null;
try {
long pos = getHeader().getSize() + fCheckpointSize * rank;
+ if (getRandomAccessFile() == null) {
+ return null;
+ }
getRandomAccessFile().seek(pos);
fByteBuffer.clear();
getRandomAccessFile().read(fByteBuffer.array());
getRandomAccessFile().seek(pos);
fByteBuffer.clear();
getRandomAccessFile().read(fByteBuffer.array());
/*******************************************************************************
/*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson
+ * Copyright (c) 2012, 2016 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
}
ITmfCheckpoint checkpoint = fTraceIndex.get(index);
TmfCoreTracer.traceIndexer("Restored checkpoint: " + checkpoint); //$NON-NLS-1$
}
ITmfCheckpoint checkpoint = fTraceIndex.get(index);
TmfCoreTracer.traceIndexer("Restored checkpoint: " + checkpoint); //$NON-NLS-1$
+ if (checkpoint == null) {
+ return fTrace.seekEvent((ITmfLocation) null);
+ }
location = checkpoint.getLocation();
}
}
location = checkpoint.getLocation();
}
}