Skip to content

Commit 70e6b31

Browse files
Merge pull request #71 from yuriy-glotanov/2025.1
RELEASE 2025.1
2 parents 2daf127 + 8367dc6 commit 70e6b31

File tree

9 files changed

+537
-265
lines changed

9 files changed

+537
-265
lines changed

src/main/java/su/interference/core/Instance.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -622,15 +622,12 @@ public Map getFramesMap () {
622622
return ixf.getMap();
623623
}
624624

625-
public List<FrameData> getSortedDataFrames (Map<Integer, DataFile> dfsmap, int type) {
625+
public List<FrameData> getSortedDataFrames (int fileId) {
626626
final MapField ixf = tFrameData.getMapFieldByColumn("frameId");
627627
final ArrayList<FrameData> r = new ArrayList<>();
628-
//ixf.getMap().values().stream().map(o -> ((DataChunk) o).getEntity()).filter(o -> dfsmap.get(((FrameData) o).getAllocFile()).getType() == type).sorted().forEach(o -> r.add((FrameData) o));
629628
for (Object o : ixf.getMap().values()) {
630629
FrameData fd = (FrameData) ((DataChunk) o).getEntity();
631-
int fileId = (int) fd.getFile();
632-
System.out.println(fileId);
633-
if (dfsmap.get(fileId).getType() == type) {
630+
if (fd.getFile() == fileId) {
634631
r.add(fd);
635632
}
636633
}

src/main/java/su/interference/core/TransCleanUp.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private void cleanUp() {
7474
try {
7575
for (Transaction t : Instance.getInstance().getTransactions()) {
7676
ArrayList<Long> fptr = new ArrayList<>();
77-
if (t.getTransType() == Transaction.TRAN_THR && t.getCid() > 0) {
77+
if ((t.getTransType() == Transaction.TRAN_THR || t.getTransType() == Transaction.TRAN_RBC) && t.getCid() > 0) {
7878
int i = 0;
7979
for (TransFrame tf : Instance.getInstance().getTransFramesByTransId(t.getTransId())) {
8080
if (t.isLocal()) {
@@ -104,7 +104,11 @@ private void cleanUp() {
104104
session.delete(tf);
105105
i++;
106106
}
107-
t.setTransType(Transaction.TRAN_LEGACY);
107+
if (t.getTransType() == Transaction.TRAN_THR) {
108+
t.setTransType(Transaction.TRAN_LEGACY);
109+
} else if (t.getTransType() == Transaction.TRAN_RBC) {
110+
t.setTransType(Transaction.TRAN_LEGACY_RBC);
111+
}
108112
session.persist(t);
109113
logger.info(i+" transaction frames removed for transaction id = "+t.getTransId());
110114
}

src/main/java/su/interference/mgmt/MgmtContainer.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ this software and associated documentation files (the "Software"), to deal in
3636
public class MgmtContainer {
3737
MgmtColumn mgmtColumn;
3838
MgmtAction mgmtAction;
39+
MgmtLink mgmtLink;
3940
Field field;
4041
Method method;
4142
Class c;
4243
Field idField;
4344

44-
public MgmtContainer(MgmtColumn mgmtColumn, MgmtAction mgmtAction, Field field, Method method, Class c, Field idField) {
45+
public MgmtContainer(MgmtColumn mgmtColumn, MgmtAction mgmtAction, MgmtLink mgmtLink, Field field, Method method, Class c, Field idField) {
4546
this.mgmtColumn = mgmtColumn;
4647
this.mgmtAction = mgmtAction;
48+
this.mgmtLink = mgmtLink;
4749
this.field = field;
4850
this.method = method;
4951
this.c = c;
@@ -82,14 +84,18 @@ public String getHeader() {
8284
}
8385
}
8486

85-
public String getValue(Object o) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
87+
public String getValue(Object o, String objectId, String sessionId, int pageId) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
8688
if (this.mgmtColumn == null || this.field == null) {
8789
return null;
8890
} else {
8991
String getName = "get" + this.field.getName().substring(0,1).toUpperCase() + this.field.getName().substring(1);
9092
Method m = this.c.getMethod(getName, null);
9193
Object result = m.invoke(o, null);
92-
return String.valueOf(result);
94+
if (this.mgmtLink != null) {
95+
return "<a href=\"?showtable="+objectId+"&session_id="+sessionId+"&page_id=10\">"+result+"</a>";
96+
} else {
97+
return String.valueOf(result);
98+
}
9399
}
94100
}
95101

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package su.interference.mgmt;
2+
3+
import java.lang.annotation.Retention;
4+
import java.lang.annotation.RetentionPolicy;
5+
6+
@Retention(RetentionPolicy.RUNTIME)
7+
public @interface MgmtLink {
8+
String type();
9+
String retrieveMethod();
10+
}

src/main/java/su/interference/persistent/FrameData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public class FrameData implements Serializable, Comparable, FrameApi, FilePartit
6363

6464
@Column
6565
@IndexColumn
66-
@MgmtColumn(name="Frame Id",width=20)
6766
private volatile int objectId;
6867
@Column
6968
@MgmtColumn(name="File Id",width=10)
@@ -104,6 +103,7 @@ public class FrameData implements Serializable, Comparable, FrameApi, FilePartit
104103
@Id
105104
@MapColumn
106105
@Transient
106+
@MgmtColumn(name="Frame Id",width=20)
107107
private long frameId; //virtual Id field
108108
@Transient
109109
private final Map<Long, Map<Long, TransFrame>> tcounter = new ConcurrentHashMap<>();

0 commit comments

Comments
 (0)