import java.io.File;
import java.io.IOException;
-import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
+import java.util.logging.Logger;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.common.core.log.TraceCompassLog;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder;
import org.eclipse.tracecompass.statesystem.core.backend.IStateHistoryBackend;
import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
private static final String PARENT = ".."; //$NON-NLS-1$
private static final String WILDCARD = "*"; //$NON-NLS-1$
+ private static final Logger LOGGER = TraceCompassLog.getLogger(StateSystem.class);
+
/* References to the inner structures */
private final AttributeTree attributeTree;
private final TransientState transState;
//--------------------------------------------------------------------------
@Override
- public void modifyAttribute(long t, ITmfStateValue value, int attributeQuark)
+ public void modifyAttribute(long t, @NonNull ITmfStateValue value, int attributeQuark)
throws TimeRangeException, StateValueTypeException {
- if (value == null) {
- /*
- * TODO Replace with @NonNull parameter (will require fixing all the
- * state providers!)
- */
- throw new IllegalArgumentException();
- }
transState.processStateChange(t, value, attributeQuark);
}
}
@Override
- public void pushAttribute(long t, ITmfStateValue value, int attributeQuark)
+ public void pushAttribute(long t, @NonNull ITmfStateValue value, int attributeQuark)
throws TimeRangeException, StateValueTypeException {
int stackDepth;
int subAttributeQuark;
throw new StateSystemDisposedException();
}
+ LOGGER.info(() -> "[StateSystem:FullQueryStart] ssid=" + this.getSSID() + ", ts=" + t); //$NON-NLS-1$//$NON-NLS-2$
+
final int nbAttr = getNbAttributes();
List<@Nullable ITmfStateInterval> stateInfo = new ArrayList<>(nbAttr);
throw new IllegalStateException("Incoherent interval storage"); //$NON-NLS-1$
}
}
+ LOGGER.info(() -> "[StateSystem:FullQueryEnd]"); //$NON-NLS-1$
return stateInfo;
}
throw new StateSystemDisposedException();
}
+ LOGGER.info(() -> "[StateSystem:SingleQueryStart] ssid=" + this.getSSID() + ", ts=" + t + ", attribute=" + attributeQuark); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+
ITmfStateInterval ret = transState.getIntervalAt(t, attributeQuark);
if (ret == null) {
/*
*/
throw new IllegalStateException("Incoherent interval storage"); //$NON-NLS-1$
}
+ LOGGER.info(() -> "[StateSystem:SingleQueryEnd]"); //$NON-NLS-1$
return ret;
}
+ @Override
+ public void removeFiles() {
+ backend.removeFiles();
+ }
+
//--------------------------------------------------------------------------
// Debug methods
//--------------------------------------------------------------------------
attribute + " at time " + timestamp + //$NON-NLS-1$
", returning dummy interval"); //$NON-NLS-1$
}
-
- /**
- * Print out the contents of the inner structures.
- *
- * @param writer
- * The PrintWriter in which to print the output
- */
- public void debugPrint(@NonNull PrintWriter writer) {
- getAttributeTree().debugPrint(writer);
- transState.debugPrint(writer);
- backend.debugPrint(writer);
- }
-
}