]> source.dussan.org Git - jackcess.git/commitdiff
remove debug output
authorJames Ahlborn <jtahlborn@yahoo.com>
Wed, 7 Sep 2016 00:54:29 +0000 (00:54 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Wed, 7 Sep 2016 00:54:29 +0000 (00:54 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/mutateops@1028 f203690c-595d-4dc9-a70b-905162fa7fd2

src/main/java/com/healthmarketscience/jackcess/impl/ByteUtil.java
src/main/java/com/healthmarketscience/jackcess/impl/LongValueColumnImpl.java
src/main/java/com/healthmarketscience/jackcess/impl/RelationshipCreator.java
src/main/java/com/healthmarketscience/jackcess/impl/TableCreator.java
src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java
src/main/java/com/healthmarketscience/jackcess/impl/TableUpdater.java

index 96285e8eb47d0b41310ed03e1c51d12dbd008bb4..efb5587f2afdb5e934a023f9c142e6ec6180810a 100644 (file)
@@ -408,7 +408,6 @@ public final class ByteUtil {
     byte[] buf = buffer.array();
     int pos = buffer.position();
     int limit = buffer.limit();
-    System.out.println("FOO insert " + pos + " " + len + " " + limit + " " + buffer.capacity());
     System.arraycopy(buf, pos, buf, pos + len, limit - pos);
     Arrays.fill(buf, pos, pos + len, (byte)0);
     buffer.limit(limit + len);
index 6caf27c78939ac23783823a2e2d1f6a03911b38e..8a137ea3dc5c93bee5395fec20745afc9c1c5ed6 100644 (file)
@@ -68,7 +68,6 @@ class LongValueColumnImpl extends ColumnImpl
   
   @Override
   void setUsageMaps(UsageMap ownedPages, UsageMap freeSpacePages) {
-    System.out.println("FOO setting col umaps " + ownedPages);
     _lvalBufferH = new UmapLongValueBufferHolder(ownedPages, freeSpacePages);
   }
 
index dcfdf3d3b5ee20c539505b88b1da2abf28f62f2b..aee71aeab329d7e25ea50908dafb96eaae0785e0 100644 (file)
@@ -30,6 +30,7 @@ import com.healthmarketscience.jackcess.RelationshipBuilder;
 import com.healthmarketscience.jackcess.Row;
 
 /**
+ * Helper class used to maintain state during relationship creation.
  *
  * @author James Ahlborn
  */
index df6076a9318775f1e1048cf1266cf99c3e3637fe..cb7d1292cd907854fb5f60575a31dd3f43c7c738 100644 (file)
@@ -181,7 +181,7 @@ public class TableCreator extends TableMutator
       }
     }
 
-    getPageChannel().startWrite();
+    getPageChannel().startExclusiveWrite();
     try {
       
       // reserve some pages
index 83f96f6ab28ad439012eeb3035c1c0ec96cb9cd3..e1b0d1e843732d464ba9e8180763646e7818d394 100644 (file)
@@ -227,10 +227,6 @@ public class TableImpl implements Table
     _name = name;
     _flags = flags;
 
-    System.out.println("FOO " + _name + " tdefLen " + tableBuffer.getInt(8) + 
-                       " free " +
-                       tableBuffer.getShort(database.getFormat().OFFSET_FREE_SPACE));
-
     // read table definition
     tableBuffer = loadCompleteTableDefinitionBuffer(tableBuffer, null);
 
@@ -266,8 +262,6 @@ public class TableImpl implements Table
       // keep reading ...
     }
 
-    System.out.println("FOO done " + tableBuffer.position());
-    
     // re-sort columns if necessary
     if(getDatabase().getColumnOrder() != ColumnOrder.DATA) {
       Collections.sort(_columns, DISPLAY_ORDER_COMPARATOR);
@@ -1052,10 +1046,6 @@ public class TableImpl implements Table
   {
     buffer.rewind();
     int totalTableDefSize = buffer.remaining();
-    System.out.println("FOO writing tdef to " + tdefPageNumber + " and " +
-                       reservedPages + " tot size " + totalTableDefSize + " " +
-                       buffer.remaining());
-
     JetFormat format = mutator.getFormat();
     PageChannel pageChannel = mutator.getPageChannel();
 
@@ -1074,8 +1064,6 @@ public class TableImpl implements Table
       
     } else {
 
-      System.out.println("FOO splitting tdef");
-
       // need to split across multiple pages
 
       ByteBuffer partialTdef = pageChannel.createPageBuffer();
@@ -1204,15 +1192,12 @@ public class TableImpl implements Table
       // skip existing column names and write new name
       skipNames(tableBuffer, _columns.size());
       ByteUtil.insertEmptyData(tableBuffer, nameByteLen);
-      System.out.println("FOO pre name " + tableBuffer.position());
       writeName(tableBuffer, column.getName(), mutator.getCharset());
-      System.out.println("FOO post name " + tableBuffer.position());
 
       if(isLongVal) {
 
         // allocate usage maps for the long value col
         Map.Entry<Integer,Integer> umapInfo = addUsageMaps(2, null);
-        System.out.println("FOO created umap " + umapInfo);
         TableMutator.ColumnState colState = mutator.getColumnState(column);
         colState.setUmapPageNumber(umapInfo.getKey());
         byte rowNum = umapInfo.getValue().byteValue();
@@ -1220,13 +1205,10 @@ public class TableImpl implements Table
         colState.setUmapFreeRowNumber((byte)(rowNum + 1));
 
         // skip past index defs
-        System.out.println("FOO pre move " + tableBuffer.position());
         ByteUtil.forward(tableBuffer, (_indexCount * 
                                        format.SIZE_INDEX_COLUMN_BLOCK));
-        System.out.println("FOO moved to " + tableBuffer.position());
         ByteUtil.forward(tableBuffer,
                          (_logicalIndexCount * format.SIZE_INDEX_INFO_BLOCK));
-        System.out.println("FOO moved to " + tableBuffer.position());
         skipNames(tableBuffer, _logicalIndexCount);
 
         // skip existing usage maps
@@ -1243,7 +1225,6 @@ public class TableImpl implements Table
         }
 
         // write new column usage map info
-        System.out.println("FOO about to write " + tableBuffer.position());
         umapPos = tableBuffer.position();
         ByteUtil.insertEmptyData(tableBuffer, 10);
         ColumnImpl.writeColUsageMapDefinition(
@@ -1359,7 +1340,6 @@ public class TableImpl implements Table
       TableMutator.IndexDataState idxDataState = mutator.getIndexDataState(index);
       int rootPageNumber = getPageChannel().allocateNewPage();
       Map.Entry<Integer,Integer> umapInfo = addUsageMaps(1, rootPageNumber);
-      System.out.println("FOO created umap " + umapInfo);
       idxDataState.setRootPageNumber(rootPageNumber);
       idxDataState.setUmapPageNumber(umapInfo.getKey());
       idxDataState.setUmapRowNumber(umapInfo.getValue().byteValue());
@@ -1566,7 +1546,6 @@ public class TableImpl implements Table
     int origTdefLen = tableBuffer.getInt(8);
     mutator.setOrigTdefLen(origTdefLen);
     int newTdefLen = origTdefLen + addedLen;
-    System.out.println("FOO new " + newTdefLen + " add " + addedLen);
     while(newTdefLen > tableBuffer.capacity()) {
       tableBuffer = expandTableBuffer(tableBuffer);
       tableBuffer.flip();
@@ -1600,7 +1579,6 @@ public class TableImpl implements Table
     // numbers), so we sort in reverse order.
     Set<Integer> knownPages = new TreeSet<Integer>(Collections.reverseOrder());
     collectUsageMapPages(knownPages);
-    System.out.println("FOO found umap pages " + knownPages);
 
     ByteBuffer umapBuf = pageChannel.createPageBuffer();
     for(Integer pageNum : knownPages) {
@@ -1874,7 +1852,6 @@ public class TableImpl implements Table
       }
       getPageChannel().readPage(nextPageBuffer, nextPage);
       nextPage = nextPageBuffer.getInt(getFormat().OFFSET_NEXT_TABLE_DEF_PAGE);
-      System.out.println("FOO next page free " + nextPageBuffer.getShort(getFormat().OFFSET_FREE_SPACE));
       tableBuffer = expandTableBuffer(tableBuffer);
       tableBuffer.put(nextPageBuffer.array(), 8, getFormat().PAGE_SIZE - 8);
       tableBuffer.flip();
index 724a1faed8eddaa5094050cd9786ce4191d726d3..8d8f348b5e523f8e6f66cbb3cc760312ad9682f5 100644 (file)
@@ -168,6 +168,8 @@ public class TableUpdater extends TableMutator
     if(!isInternal) {
       getPageChannel().startExclusiveWrite();
     } else {
+      // if "internal" update, this is part of a larger operation which
+      // already holds an exclusive write lock
       getPageChannel().startWrite();      
     }
     try {