Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/su/interference/core/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public class Config {
public final int READ_BUFFER_SIZE = 33554432;
public final int WRITE_BUFFER_SIZE = 33554432;
// cleanup
public final int TRANS_CLEANUP_TIMEOUT = 5000;
public final int CLEANUP_TIMEOUT = 3000;
public final int CLEANUP_PROTECTION_THR = 1000;
public final int IX_CLEANUP_PROTECTION_THR = 5000;
Expand Down
14 changes: 8 additions & 6 deletions src/main/java/su/interference/core/DataChunk.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,6 @@ public Table getT() {
return t;
}

protected void setT(Table t) {
this.t = t;
}

public Comparable getId (Field idfield, Session s) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException {
if (serializedId==null) {
if (entity==null) {
Expand Down Expand Up @@ -325,12 +321,18 @@ public DataChunk (ValueSet vs, Session s, Table t) {

//serializer INSERT ONLY!!! (with generate Id value)
public DataChunk (Object o, Session s) {
this(o, s, null);
this(o, s, null, null);
}

//serializer INSERT ONLY!!! (with generate Id value)
public DataChunk (Object o, Session s, Table t) {
this(o, s, null, t);
}

//serializer INSERT ONLY!!! (with generate Id value) - rowid for index chunk
public DataChunk (Object o, Session s, RowId r) {
public DataChunk (Object o, Session s, RowId r, Table t) {
this.entity = o;
this.t = t;
this.state = NORMAL_STATE;
this.header = new RowHeader(r, null, getChunk().length, false);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/su/interference/core/SyncFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public SyncFrame(Frame frame, Session s, FreeFrame fb, boolean proc) throws Exce
className = bd == null ? null : t.getName();

rtran = frame.getLiveTransactions();
uframes = allowR ? bd.getLiveUFrameAllocIds() : null;
uframes = allowR ? bd == null ? null : bd.getLiveUFrameAllocIds() : null;

if (frame.getClass().getName().equals("su.interference.core.DataFrame")) {
if (frame.getType()!=0) {
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/su/interference/persistent/FrameData.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public ArrayList<Object> getFrameEntities(Session s) throws Exception {

public Frame getFrame() throws Exception {
if (frame == null) {
if (getDataObject().isIndex()) {
if (isIndex()) {
frame = getIndexFrame();
} else {
frame = getDataFrame();
Expand All @@ -222,6 +222,10 @@ public Frame getFrame() throws Exception {
return frame;
}

public boolean isIndex() {
return getDataObject().isIndex();
}

public boolean isFrame() {
return frame != null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/su/interference/persistent/Table.java
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ protected DataChunk persist (final Object o, final Session s, final LLT extllt)
this.ident(o, s, llt); //ident system entities during persist
}

final DataChunk nc = new DataChunk(o, s);
final DataChunk nc = new DataChunk(o, s, this);
final int len = nc.getBytesAmount();
final WaitFrame bdw = getAvailableFrame(o, fpart);
final FrameData bd = bdw.getBd();
Expand Down Expand Up @@ -1797,7 +1797,7 @@ private byte[] append(byte[] b, byte[] toAdd){
//rowid used in DataChunk constructor for build standalone indexes
private synchronized void add (RowId rowid, Object o, Session s, LLT extllt) throws Exception {

final DataChunk dc = new DataChunk(o, s, rowid);
final DataChunk dc = new DataChunk(o, s, rowid, this);
final int len = dc.getBytesAmount();
dc.getHeader().setTran(s.getTransaction());

Expand Down