use of io.questdb.cairo.vm.api.MemoryMAR in project questdb by bluestreak01.
the class TableWriterTest method testTableWriterCustomPageSize.
@Test
public void testTableWriterCustomPageSize() throws Exception {
TestUtils.assertMemoryLeak(() -> {
create(FF, PartitionBy.DAY, 10000);
CairoConfiguration configuration = new DefaultCairoConfiguration(root) {
@Override
public long getDataAppendPageSize() {
return getFilesFacade().getPageSize();
}
};
try (TableWriter w = new TableWriter(configuration, PRODUCT)) {
long ts = TimestampFormatUtils.parseTimestamp("2013-03-04T00:00:00.000Z");
Rnd rnd = new Rnd();
for (int i = 0; i < 100; i++) {
ts = populateRow(w, rnd, ts, 60L * 60000L * 1000L);
}
w.commit();
for (int i = 0, n = w.columns.size(); i < n; i++) {
MemoryMAR m = w.columns.getQuick(i);
if (m != null) {
Assert.assertEquals(configuration.getDataAppendPageSize(), m.getExtendSegmentSize());
}
}
}
});
}
use of io.questdb.cairo.vm.api.MemoryMAR in project questdb by bluestreak01.
the class O3PartitionJob method processPartition.
public static void processPartition(long tmpBuf, O3PartitionTask task, long cursor, Sequence subSeq) {
// find "current" partition boundary in the out of order data
// once we know the boundary we can move on to calculating another one
// srcOooHi is index inclusive of value
final CharSequence pathToTable = task.getPathToTable();
final int partitionBy = task.getPartitionBy();
final ObjList<MemoryMAR> columns = task.getColumns();
final ObjList<MemoryCARW> oooColumns = task.getO3Columns();
final long srcOooLo = task.getSrcOooLo();
final long srcOooHi = task.getSrcOooHi();
final long srcOooMax = task.getSrcOooMax();
final long oooTimestampMin = task.getOooTimestampMin();
final long oooTimestampMax = task.getOooTimestampMax();
final long partitionTimestamp = task.getPartitionTimestamp();
final long maxTimestamp = task.getMaxTimestamp();
final long srcDataMax = task.getSrcDataMax();
final long srcDataTxn = task.getSrcNameTxn();
final boolean last = task.isLast();
final long txn = task.getTxn();
final long sortedTimestampsAddr = task.getSortedTimestampsAddr();
final TableWriter tableWriter = task.getTableWriter();
final AtomicInteger columnCounter = task.getColumnCounter();
final O3Basket o3Basket = task.getO3Basket();
subSeq.done(cursor);
processPartition(pathToTable, partitionBy, columns, oooColumns, srcOooLo, srcOooHi, srcOooMax, oooTimestampMin, oooTimestampMax, partitionTimestamp, maxTimestamp, srcDataMax, srcDataTxn, last, txn, sortedTimestampsAddr, tableWriter, columnCounter, o3Basket, tmpBuf);
}
Aggregations