@Override protected AllocationComponentOperationPair concreteCreatePair(final SynchronousCallMessage callMsg) { final AllocationComponent allocationComponent = callMsg.getReceivingExecution().getAllocationComponent(); final Operation op = callMsg.getReceivingExecution().getOperation(); final AllocationComponentOperationPair destination = AggregatedAllocationComponentOperationCallTreeFilter.this.getSystemEntityFactory() .getAllocationPairFactory().getPairInstanceByPair(allocationComponent, op); // will never be null! return destination; } }
final AllocationComponent senderComponent = me.getSendingExecution().getAllocationComponent(); final AllocationComponent receiverComponent = me.getReceivingExecution().getAllocationComponent(); if (!plottedComponentIds.contains(senderComponent.getId())) { ps.print("object(O" + senderComponent.getId() + ",\"" + senderComponent.getExecutionContainer().getName() + "::\",\"" final AssemblyComponent senderComponent = me.getSendingExecution().getAllocationComponent().getAssemblyComponent(); final AssemblyComponent receiverComponent = me.getReceivingExecution().getAllocationComponent().getAssemblyComponent(); if (!plottedComponentIds.contains(senderComponent.getId())) { ps.print("object(O" + senderComponent.getId() + ",\"\",\"" + SequenceDiagramFilter.assemblyComponentLabel(senderComponent, shortLabels) + "\");" final AllocationComponent senderComponent = me.getSendingExecution().getAllocationComponent(); final AllocationComponent receiverComponent = me.getReceivingExecution().getAllocationComponent(); senderDotId = "O" + senderComponent.getId(); receiverDotId = "O" + receiverComponent.getId(); } else if (sdMode == SDModes.ASSEMBLY) { final AssemblyComponent senderComponent = me.getSendingExecution().getAllocationComponent().getAssemblyComponent(); final AssemblyComponent receiverComponent = me.getReceivingExecution().getAllocationComponent().getAssemblyComponent(); senderDotId = "O" + senderComponent.getId(); receiverDotId = "O" + receiverComponent.getId();
/** * {@inheritDoc} */ @Override protected AssemblyComponentOperationPair concreteCreatePair(final SynchronousCallMessage callMsg) { final Execution execution = callMsg.getReceivingExecution(); final AssemblyComponent assemblyComponent = execution.getAllocationComponent().getAssemblyComponent(); final Operation op = execution.getOperation(); return this.getSystemEntityFactory().getAssemblyPairFactory().getPairInstanceByPair(assemblyComponent, op); } }
@Override public AllocationComponentOperationPair createPair(final SynchronousCallMessage callMsg) { final AllocationComponent allocationComponent = callMsg.getReceivingExecution().getAllocationComponent(); final Operation op = callMsg.getReceivingExecution().getOperation(); final AllocationComponentOperationPair destination = TraceCallTreeFilter.this.getSystemEntityFactory().getAllocationPairFactory() .getPairInstanceByPair(allocationComponent, op); // will never be null! return destination; } }, mt, TraceCallTreeFilter.this.dotOutputFn + "-" + mt.getTraceId() + ".dot", false, TraceCallTreeFilter.this.shortLabels); // no weights
/** * Checks whether the given executions are equal or not. * * @param r1 * The first execution object. * @param r2 * The second execution object. * * @return true if and only if the executions have the same values. */ private boolean executionsEqual(final Execution r1, final Execution r2) { if (r1 == r2) { // NOPMD (no equals) return true; } if ((r1 == null) || (r2 == null)) { return false; } return (r1.getAllocationComponent().getId() == r2.getAllocationComponent().getId()) && (r1.getOperation().getId() == r2.getOperation().getId()) && (r1.getEoi() == r2.getEoi()) && (r1.getEss() == r2.getEss()); }
/** * Creates a new instance of this class using the given parameters. * * @param t * The execution trace to be stored in this container. */ public ExecutionTraceHashContainerAllocationEquivalence(final ExecutionTrace t) { super(t); final int prime = 31; int result = 1; for (final Execution r : t.getTraceAsSortedExecutionSet()) { result = (prime * result) + r.getOperation().getId(); result = (prime * result) + r.getAllocationComponent().getId(); result = (prime * result) + r.getEoi(); result = (prime * result) + r.getEss(); } // this.hashcodeBuffer = result; }
/** * Checks whether the given executions are equal or not. * * @param r1 * The first execution object. * @param r2 * The second execution object. * * @return true if and only if the executions have the same values. */ private boolean executionsEqual(final Execution r1, final Execution r2) { if (r1 == r2) { // NOPMD (no equals) return true; } if ((r1 == null) || (r2 == null)) { return false; } return (r1.getAllocationComponent().getAssemblyComponent().getId() == r2.getAllocationComponent().getAssemblyComponent().getId()) && (r1.getOperation().getId() == r2.getOperation().getId()) && (r1.getEoi() == r2.getEoi()) && (r1.getEss() == r2.getEss()); }
/** * Creates a new instance of this class using the given parameters. * * @param t * The execution trace to be stored in this container. */ public ExecutionTraceHashContainerAssemblyEquivalence(final ExecutionTrace t) { super(t); final int prime = 31; int result = 1; for (final Execution r : t.getTraceAsSortedExecutionSet()) { result = (prime * result) + r.getOperation().getId(); result = (prime * result) + r.getAllocationComponent().getAssemblyComponent().getId(); result = (prime * result) + r.getEoi(); result = (prime * result) + r.getEss(); } // this.hashCodeBuffer = result; }
/** * This method can be used to debug the {@link java.util.Comparator} provided by {@link ExecutionTrace#createExecutionTraceComparator()}. */ @Test public void testTreeSet() { final SortedSet<Execution> s0 = new TreeSet<>(ExecutionTrace.createExecutionTraceComparator()); final SortedSet<Execution> s1 = new TreeSet<>(ExecutionTrace.createExecutionTraceComparator()); final Execution execFromTrace0 = this.exec0_0__bookstore_searchBook; final Execution long1 = new Execution(execFromTrace0.getOperation(), execFromTrace0.getAllocationComponent(), execFromTrace0.getTraceId(), execFromTrace0.getSessionId(), execFromTrace0.getEoi(), execFromTrace0.getEss(), execFromTrace0.getTin(), execFromTrace0.getTout(), execFromTrace0.isAssumed()); s0.add(execFromTrace0); s1.add(long1); Assert.assertEquals("Expected sets to be equal", s0, s1); }
@Before public void setUp() throws Exception { final SystemModelRepository systemEntityFactory = new SystemModelRepository(new Configuration(), new AnalysisController()); this.eFactory = new ExecutionFactory(systemEntityFactory); int myNumExecutions = 0; // Manually create Executions for a trace myNumExecutions++; this.exec0_0__bookstore_searchBook = this.eFactory.genExecution("Bookstore", "bookstore", "searchBook", TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID, 1, 10, 0, 0); this.minTin = this.exec0_0__bookstore_searchBook.getTin(); this.maxTout = this.exec0_0__bookstore_searchBook.getTout(); myNumExecutions++; this.exec1_1__catalog_getBook = this.eFactory.genExecution("Catalog", "catalog", "getBook", TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID, 2, 4, 1, 1); myNumExecutions++; this.exec2_1__crm_getOrders = this.eFactory.genExecution("CRM", "crm", "getOrders", TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID, 5, 8, 2, 1); myNumExecutions++; this.exec3_2__catalog_getBook = this.eFactory.genExecution("Catalog", "catalog", "getBook", TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID, 6, 7, 3, 2); // Just some basic checks to make sure that the trace has been set up properly (we've had some trouble here) Assert.assertNotSame(this.exec3_2__catalog_getBook.getOperation(), this.exec2_1__crm_getOrders.getOperation()); Assert.assertNotSame(this.exec0_0__bookstore_searchBook.getAllocationComponent(), this.exec1_1__catalog_getBook.getAllocationComponent()); this.numExecutions = myNumExecutions; }
continue; final AllocationComponent senderComponent = m.getSendingExecution().getAllocationComponent(); final AllocationComponent receiverComponent = m.getReceivingExecution().getAllocationComponent(); final ExecutionContainer senderContainer = senderComponent.getExecutionContainer(); final ExecutionContainer receiverContainer = receiverComponent.getExecutionContainer();
final Execution variationTemplate) { Operation op = executionTemplate.getOperation(); AllocationComponent allocComp = executionTemplate.getAllocationComponent(); long traceId = executionTemplate.getTraceId(); String sessionId = executionTemplate.getSessionId(); allocComp = variationTemplate.getAllocationComponent(); break; case EOI:
continue; final AllocationComponent senderComponent = m.getSendingExecution().getAllocationComponent(); final AllocationComponent receiverComponent = m.getReceivingExecution().getAllocationComponent(); DependencyGraphNode<AllocationComponent> senderNode = this.getGraph().getNode(senderComponent.getId()); DependencyGraphNode<AllocationComponent> receiverNode = this.getGraph().getNode(receiverComponent.getId());
continue; final AssemblyComponent senderComponent = m.getSendingExecution().getAllocationComponent().getAssemblyComponent(); final AssemblyComponent receiverComponent = m.getReceivingExecution().getAllocationComponent().getAssemblyComponent(); DependencyGraphNode<AssemblyComponent> senderNode = this.getGraph().getNode(senderComponent.getId()); DependencyGraphNode<AssemblyComponent> receiverNode = this.getGraph().getNode(receiverComponent.getId());
Assert.assertEquals("eoi's differ", opExec.getEoi(), exec.getEoi()); Assert.assertEquals("ess's differ", opExec.getEss(), exec.getEss()); Assert.assertEquals("Hostnames differ", opExec.getHostname(), exec.getAllocationComponent().getExecutionContainer().getName()); Assert.assertEquals("Session ID's differ", opExec.getSessionId(), exec.getSessionId()); Assert.assertEquals("Trace ID's differ", opExec.getTraceId(), exec.getTraceId()); ClassOperationSignaturePair.splitOperationSignatureStr(opExec.getOperationSignature()); Assert.assertEquals("Class/Component type names differ", opExecClassOperationSignature.getFqClassname(), exec.getAllocationComponent().getAssemblyComponent().getType().getFullQualifiedName()); Assert.assertEquals("Signatures differ", opExecClassOperationSignature.getSignature(), exec.getOperation().getSignature());
continue; final AllocationComponent senderComponent = m.getSendingExecution().getAllocationComponent(); final AllocationComponent receiverComponent = m.getReceivingExecution().getAllocationComponent(); final int rootOperationId = OperationRepository.ROOT_OPERATION.getId(); final Operation senderOperation = m.getSendingExecution().getOperation();
continue; final AssemblyComponent senderComponent = m.getSendingExecution().getAllocationComponent().getAssemblyComponent(); final AssemblyComponent receiverComponent = m.getReceivingExecution().getAllocationComponent().getAssemblyComponent(); final int rootOperationId = OperationRepository.ROOT_OPERATION.getId(); final Operation senderOperation = m.getSendingExecution().getOperation();
final Execution variationTemplate = new Execution(this.exec1_1__catalog_getBook.getOperation(), this.exec1_1__catalog_getBook.getAllocationComponent(), this.exec1_1__catalog_getBook.getTraceId() + 100, this.exec1_1__catalog_getBook.getSessionId() + "_", this.exec1_1__catalog_getBook.getEoi() + 100, this.exec1_1__catalog_getBook.getEss() + 100,