public boolean isFull() { if (info.isRowBlockEnabled()) return nRows >= info.rowBlockSize; else return nRows > 0; }
/** write data to given buffer, like serialize */ public void export(ByteBuffer buf) { buf.putInt(seqId); if (info.isRowBlockEnabled()) buf.putInt(nRows); export(primaryKey, buf); for (ByteArray cb : cellBlocks) { export(cb, buf); } }
/** write data to given output stream, like serialize */ public void export(DataOutputStream out) throws IOException { out.writeInt(seqId); if (info.isRowBlockEnabled()) out.writeInt(nRows); export(out, primaryKey); for (ByteArray cb : cellBlocks) { export(out, cb); } }
/** read data from given input stream, like deserialize */ public void importFrom(DataInputStream in) throws IOException { seqId = in.readInt(); nRows = info.isRowBlockEnabled() ? in.readInt() : 1; importFrom(in, primaryKey); for (int i = 0; i < info.colBlocks.length; i++) { ByteArray cb = cellBlocks[i]; importFrom(in, cb); } }
public int exportLength() { int len = 4; // seq Id if (info.isRowBlockEnabled()) len += 4; // nRows len += 4 + primaryKey.length(); // PK byte array for (ByteArray array : cellBlocks) { len += 4 + array.length(); // cell block byte array } return len; }
/** create a row block, allocate memory, get ready for writing */ public static GTRowBlock allocate(GTInfo info) { GTRowBlock b = new GTRowBlock(info); byte[] array = new byte[info.getMaxColumnLength(info.primaryKey)]; b.primaryKey.reset(array, 0, array.length); int maxRows = info.isRowBlockEnabled() ? info.rowBlockSize : 1; for (int i = 0; i < b.cellBlocks.length; i++) { array = new byte[info.getMaxColumnLength(info.colBlocks[i]) * maxRows]; b.cellBlocks[i].reset(array, 0, array.length); } return b; }
public boolean isFull() { if (info.isRowBlockEnabled()) return nRows >= info.rowBlockSize; else return nRows > 0; }
/** write data to given buffer, like serialize */ public void export(ByteBuffer buf) { buf.putInt(seqId); if (info.isRowBlockEnabled()) buf.putInt(nRows); export(primaryKey, buf); for (ByteArray cb : cellBlocks) { export(cb, buf); } }
/** write data to given output stream, like serialize */ public void export(DataOutputStream out) throws IOException { out.writeInt(seqId); if (info.isRowBlockEnabled()) out.writeInt(nRows); export(out, primaryKey); for (ByteArray cb : cellBlocks) { export(out, cb); } }
/** read data from given input stream, like deserialize */ public void importFrom(DataInputStream in) throws IOException { seqId = in.readInt(); nRows = info.isRowBlockEnabled() ? in.readInt() : 1; importFrom(in, primaryKey); for (int i = 0; i < info.colBlocks.length; i++) { ByteArray cb = cellBlocks[i]; importFrom(in, cb); } }
public int exportLength() { int len = 4; // seq Id if (info.isRowBlockEnabled()) len += 4; // nRows len += 4 + primaryKey.length(); // PK byte array for (ByteArray array : cellBlocks) { len += 4 + array.length(); // cell block byte array } return len; }
/** create a row block, allocate memory, get ready for writing */ public static GTRowBlock allocate(GTInfo info) { GTRowBlock b = new GTRowBlock(info); byte[] array = new byte[info.getMaxColumnLength(info.primaryKey)]; b.primaryKey.reset(array, 0, array.length); int maxRows = info.isRowBlockEnabled() ? info.rowBlockSize : 1; for (int i = 0; i < b.cellBlocks.length; i++) { array = new byte[info.getMaxColumnLength(info.colBlocks[i]) * maxRows]; b.cellBlocks[i].reset(array, 0, array.length); } return b; }