/** * Inserts a record into a block. * A single block can hold 5 records. * A new block will be programmatically created when the block becomes full. * * @param Record record - the new record to be added * @param int BlockFactor - the amount of records that can be stored per block * * @return void **/ public static void insertIntoBlock(TableRecord.Record record, int BlockingFactor) { // Look at current Block for available location // if Location Unavailable seache for available Block Addresses in existing blocks for (int i = 0; i < ActiveBlocks.Count; i++) { if (ActiveBlocks[i].RecordArray.Length < BlockingFactor) { ActiveBlocks[i].RecordArray[1, 1] = record; // Dummy Method } } BlockManager.createNewBlock(); }
public BlockManager(String ParentDirectory) { BlockManager.setHOMEDirectory(ParentDirectory); // CreateThe File for All Blocks BlockManager.createNewBlock(); // Create a new Block }