import java.sql.Clob;
import java.sql.SQLException;
import java.util.Calendar;
+import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
return new ColumnImpl(args);
}
- /**
+ /**
* Sets the usage maps for this column.
*/
void setUsageMaps(UsageMap ownedPages, UsageMap freeSpacePages) {
// base does nothing
}
+ void collectUsageMapPages(Collection<Integer> pages) {
+ // base does nothing
+ }
+
/**
* Secondary column initialization after the table is fully loaded.
*/
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
_ownedPages.addPageNumber(pageNumber);
}
+ void collectUsageMapPages(Collection<Integer> pages) {
+ pages.add(_ownedPages.getTablePageNumber());
+ }
+
/**
* Used by unit tests to validate the internal status of the index.
* @usage _advanced_method_
package com.healthmarketscience.jackcess.impl;
import java.io.IOException;
+import java.lang.reflect.Type;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
+import java.util.Collection;
/**
_lvalBufferH = new UmapLongValueBufferHolder(ownedPages, freeSpacePages);
}
+ void collectUsageMapPages(Collection<Integer> pages) {
+ // FIXME, writeme
+ }
+
@Override
void postTableLoadInit() throws IOException {
if(_lvalBufferH == null) {
import java.nio.BufferOverflowException;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
+import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
return tableBuffer;
}
+ private Map.Entry<Integer,Integer> addUsageMaps(int numMaps)
+ {
+ JetFormat format = getFormat();
+ int umapRowLength = format.OFFSET_USAGE_MAP_START +
+ format.USAGE_MAP_TABLE_BYTE_LENGTH;
+ int totalUmapSpaceUsage = getRowSpaceUsage(umapRowLength, format) * numMaps;
+ int umapPageNumber = PageChannel.INVALID_PAGE_NUMBER;
+ int firstRowNum = -1;
+ ByteBuffer umapBuf = null;
+ int freeSpace = 0;
+ int rowStart = 0;
+ int umapRowNum = 0;
+
+ // search currently known usage map buffers to find one with enough free
+ // space (the numMaps should always be small enough to put them all on one
+ // page)
+ Set<Integer> knownPages = new HashSet<Integer>();
+ collectUsageMapPages(knownPages);
+ // FIXME
+
+
+
+ return new AbstractMap.SimpleImmutableEntry<Integer,Integer>(
+ umapPageNumber, firstRowNum);
+ }
+
+ void collectUsageMapPages(Collection<Integer> pages) {
+ pages.add(_ownedPages.getTablePageNumber());
+ pages.add(_freeSpacePages.getTablePageNumber());
+
+ for(IndexData idx : _indexDatas) {
+ idx.collectUsageMapPages(pages);
+ }
+ }
+
/**
* @param buffer Buffer to write to
*/