svn commit: r161468 [2/2] - in incubator/derby/code/trunk/java: engine/org/apache/derby/catalog/ engine/org/apache/derby/iapi/db/ engine/org/apache/derby/iapi/store/access/ engine/org/apache/derby/iapi/store/access/conglomerate/ engine/org/apache/derby/iapi/store/raw/ engine/org/apache/derby/impl/sql/catalog/ engine/org/apache/derby/impl/store/access/ engine/org/apache/derby/impl/store/access/btree/ engine/org/apache/derby/impl/store/access/btree/index/ engine/org/apache/derby/impl/store/access/conglomerate/ engine/org/apache/derby/impl/store/access/heap/ engine/org/apache/derby/impl/store/access/sort/ engine/org/apache/derby/impl/store/raw/data/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/suites/ testing/org/apache/derbyTesting/functionTests/tests/store/ testing/org/apache/derbyTesting/functionTests/tests/storetests/

2005-04-15 Thread mikem
Modified: 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapController.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapController.java?view=diffr1=161467r2=161468
==
--- 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapController.java
 (original)
+++ 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapController.java
 Fri Apr 15 07:27:56 2005
@@ -70,7 +70,7 @@
 
 /**
  * Protected concrete impl of abstract methods of 
- * GenericCongloemrateController class:
+ * GenericConglomerateController class:
  **
  */
 protected final void getRowPositionFromRowLocation(
@@ -105,6 +105,93 @@
  * Private/Protected methods of This class:
  **
  */
+
+/**
+ * Check and purge committed deleted rows on a page.
+ * p
+ * 
+* @return true, if no purging has been done on page, and thus latch
+ * can be released before end transaction.  Otherwise the latch
+ * on the page can not be released before commit.
+ *
+ * @param page   A non-null, latched page must be passed in.  If all
+ *   rows on page are purged, then page will be removed and
+ *   latch released.
+ *
+* @exception  StandardException  Standard exception policy.
+ **/
+protected final boolean purgeCommittedDeletes(
+Pagepage)
+throws StandardException
+{
+boolean purgingDone = false;
+
+// The number records that can be reclaimed is:
+// total recs - recs_not_deleted
+int num_possible_commit_delete = 
+page.recordCount() - page.nonDeletedRecordCount();
+
+if (num_possible_commit_delete  0)
+{
+// loop backward so that purges which affect the slot table 
+// don't affect the loop (ie. they only move records we 
+// have already looked at).
+for (int slot_no = page.recordCount() - 1; 
+ slot_no = 0; 
+ slot_no--) 
+{
+boolean row_is_committed_delete = 
+page.isDeletedAtSlot(slot_no);
+
+if (row_is_committed_delete)
+{
+// At this point we only know that the row is
+// deleted, not whether it is committed.
+
+// see if we can purge the row, by getting an
+// exclusive lock on the row.  If it is marked
+// deleted and we can get this lock, then it
+// must be a committed delete and we can purge 
+// it.
+
+RecordHandle rh =
+page.fetchFromSlot(
+(RecordHandle) null,
+slot_no,
+RowUtil.EMPTY_ROW,
+RowUtil.EMPTY_ROW_FETCH_DESCRIPTOR,
+true);
+
+row_is_committed_delete =
+this.lockRowAtSlotNoWaitExclusive(rh);
+
+if (row_is_committed_delete)
+{
+purgingDone = true;
+
+page.purgeAtSlot(slot_no, 1, false);
+}
+}
+}
+}
+if (page.recordCount() == 0)
+{
+
+// Deallocate the current page with 0 rows on it.
+this.removePage(page);
+
+// removePage guarantees to unlatch the page even if an
+// exception is thrown. The page is protected against reuse
+// because removePage locks it with a dealloc lock, so it
+// is OK to release the latch even after a purgeAtSlot is
+// called.
+// @see ContainerHandle#removePage
+
+purgingDone = true;
+}
+
+return(purgingDone);
+}
 
 /**
  * Insert a new row into the heap.

Modified: 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapScan.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapScan.java?view=diffr1=161467r2=161468
==
--- 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapScan.java
 (original)
+++ 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapScan.java
 Fri Apr 15 07:27:56 

svn commit: r161814 - incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/storetests/BaseTest.java

2005-04-19 Thread mikem
Author: mikem
Date: Mon Apr 18 16:33:54 2005
New Revision: 161814

URL: http://svn.apache.org/viewcvs?view=revrev=161814
Log:
working on this test, real version will be in the storetests directory.


Removed:

incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/storetests/BaseTest.java



svn commit: r161965 - incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/db incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data

2005-04-19 Thread mikem
Author: mikem
Date: Tue Apr 19 13:39:43 2005
New Revision: 161965

URL: http://svn.apache.org/viewcvs?view=revrev=161965
Log:
continuing online compress work, remove debug statements.


Modified:

incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java

incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericScanController.java

incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StoredPage.java

Modified: 
incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java?view=diffr1=161964r2=161965
==
--- 
incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java
 (original)
+++ 
incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java
 Tue Apr 19 13:39:43 2005
@@ -202,7 +202,6 @@
 index_cc,
 index_row);
 
-SanityManager.DEBUG_PRINT(OnlineCompress, index_col_map =  
+ index_col_map);
 }
 
/* Open the heap for reading */
@@ -228,9 +227,6 @@
 {
 for (int index = 0; index  num_indexes; index++)
 {
-SanityManager.DEBUG_PRINT(OnlineCompress, 
calling fixIndex, row =  + row + ; index =  + index);
-SanityManager.DEBUG_PRINT(OnlineCompress, before fixIndex 
call index_col_map =  + index_col_map);
-SanityManager.DEBUG_PRINT(OnlineCompress, before fixIndex 
call index_col_map[0] =  + index_col_map[0]);
 fixIndex(
 row_array[row],
 index_row[index],
@@ -391,7 +387,6 @@
 int index_idx = 0;
 for (int cd_idx = 0; cd_idx  conglom_descriptors.length; cd_idx++)
 {
-SanityManager.DEBUG_PRINT(OnlineCompress, setup loop:  + 
cd_idx);
 ConglomerateDescriptor index_cd = conglom_descriptors[cd_idx];
 
 if (!index_cd.isIndex())
@@ -399,7 +394,6 @@
 // skip the heap descriptor entry
 continue;
 }
-SanityManager.DEBUG_PRINT(OnlineCompress, setup loop 1:  + 
cd_idx);
 
 // ScanControllers are used to delete old index row
 index_scan[index_idx] = 

Modified: 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericScanController.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericScanController.java?view=diffr1=161964r2=161965
==
--- 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericScanController.java
 (original)
+++ 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericScanController.java
 Tue Apr 19 13:39:43 2005
@@ -1015,11 +1015,6 @@
 boolean closeHeldScan)
 throws StandardException
{
-
SanityManager.DEBUG_PRINT(GenericScanController.closeForEndTransaction, 
-closeHeldScan =  + closeHeldScan +
-open_conglom.getHold() =  + open_conglom.getHold());
-
-
 if ((!open_conglom.getHold()) || closeHeldScan) 
 {
 // close the scan as part of the commit/abort

Modified: 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StoredPage.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StoredPage.java?view=diffr1=161964r2=161965
==
--- 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StoredPage.java
 (original)
+++ 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StoredPage.java
 Tue Apr 19 13:39:43 2005
@@ -6887,9 +6887,6 @@
 
 if (dest_page != null)
 {
-SanityManager.DEBUG_PRINT(moveRecordForCompressAtSlot, 
-last =  + dest_page.getPageNumber()); 
-
 if ((dest_page.getPageNumber() = getPageNumber()) ||
 (!dest_page.spaceForCopy(row_size)))
 {
@@ -6908,9 +6905,6 @@
 
 if (dest_page != null)
 {
-SanityManager.DEBUG_PRINT(moveRecordForCompressAtSlot, 
-unfill =  + dest_page.getPageNumber()); 
-
 if ((dest_page.getPageNumber() = getPageNumber()) ||
 (!dest_page.spaceForCopy(row_size

svn commit: r161974 - incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Property.java

2005-04-19 Thread mikem
Author: mikem
Date: Tue Apr 19 13:48:50 2005
New Revision: 161974

URL: http://svn.apache.org/viewcvs?view=revrev=161974
Log:
javadoc fix, can't refer to #checkpoint


Modified:

incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Property.java

Modified: 
incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Property.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Property.java?view=diffr1=161973r2=161974
==
--- 
incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Property.java
 (original)
+++ 
incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Property.java
 Tue Apr 19 13:48:50 2005
@@ -580,19 +580,16 @@
 
/**
Property name for specifying log switch interval
-   @see #checkpoint
 */
public static final String LOG_SWITCH_INTERVAL = 
derby.storage.logSwitchInterval;
 
/**
Property name for specifying checkpoint interval
-   @see #checkpoint
 */
public static final String CHECKPOINT_INTERVAL = 
derby.storage.checkpointInterval;
 
/**
Property name for specifying log archival location
-   @see #logArchived
 */
public static final String LOG_ARCHIVAL_DIRECTORY = 
derby.storage.logArchive;
 




svn commit: r165024 - /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storetests.runall

2005-04-27 Thread mikem
Author: mikem
Date: Wed Apr 27 11:24:05 2005
New Revision: 165024

URL: http://svn.apache.org/viewcvs?rev=165024view=rev
Log:
taking compress test out of nightly until test timing issue with
post commit delete reclaim issue is resolved.  Test is intermittently
getting a diff in number of btree index pages due to post commit
activity.  Investigated and determined it is a test issue, not a bug.


Modified:

incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storetests.runall

Modified: 
incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storetests.runall
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storetests.runall?rev=165024r1=165023r2=165024view=diff
==
--- 
incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storetests.runall
 (original)
+++ 
incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storetests.runall
 Wed Apr 27 11:24:05 2005
@@ -1,5 +1,4 @@
 storetests/st_schema.sql
-storetests/onlineCompressTable.sql
 storetests/st_1.sql
 storetests/st_b5772.sql
 storetests/derby94.sql




svn commit: r165169 - in /incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store: access/heap/ raw/log/ raw/xact/

2005-04-28 Thread mikem
Author: mikem
Date: Thu Apr 28 10:48:40 2005
New Revision: 165169

URL: http://svn.apache.org/viewcvs?rev=165169view=rev
Log:
more store javadoc fixes.


Modified:

incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/Heap.java

incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapController.java

incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapCostController.java

incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapPostCommit.java

incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/ChecksumOperation.java

incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/FileLogger.java

incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java

incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java

incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/StreamLogScan.java

incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/XactFactory.java

Modified: 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/Heap.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/Heap.java?rev=165169r1=165168r2=165169view=diff
==
--- 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/Heap.java
 (original)
+++ 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/Heap.java
 Thu Apr 28 10:48:40 2005
@@ -162,7 +162,7 @@
 /* Constructors for This class: */
 
 /**
- * Zero arg. constructor for Monitor to create empty object.
+ * Zero arg constructor for Monitor to create empty object.
  **/
 public Heap()
 {
@@ -982,7 +982,7 @@
  */
 
 /**
- * return the Conglomerate
+ * return the Conglomerate.
  * p
  * For heap just return this, which both implements Conglomerate and
  * StaticCompiledOpenConglomInfo.

Modified: 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapController.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapController.java?rev=165169r1=165168r2=165169view=diff
==
--- 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapController.java
 (original)
+++ 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapController.java
 Thu Apr 28 10:48:40 2005
@@ -687,10 +687,10 @@
  *
 * @return true if lock was granted, only can be false if wait was 
false.
  *
-* @param loc   The RowLocation which describes the exact row to 
lock.
- * @param forUpdate Lock the record for read or write.
- * @param forInsert is row Lock for insert?
- * @param wait  Should the lock call wait to be granted?
+ * @param page_num  Page number of row to lock.
+ * @param record_id Record id of row on page_num to lock.
+ * @param lock_operationDesc of what to lock for, ie. update, insert 
...
+ * @param wait  Should the lock call wait to be granted?
  *
 * @exception  StandardException  Standard exception policy.
  **/

Modified: 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapCostController.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapCostController.java?rev=165169r1=165168r2=165169view=diff
==
--- 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapCostController.java
 (original)
+++ 
incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapCostController.java
 Thu Apr 28 10:48:40 2005
@@ -289,7 +289,7 @@
  *conglomerate.  The startKeyValue must only
  *reference columns included in the scanColumnList.
  *
-* @param startSearchOperation 
+* @param startSearchOperator 
  *an operator which defines how the startKeyValue
  *is to be searched for.  If startSearchOperation 
  *is ScanController.GE, the scan starts on the 
@@ -308,7 +308,7 @@
  *stopKeyValue must only reference columns included
  *in the scanColumnList.
  *
-* @param stopSearchOperation
+* @param stopSearchOperator
  *an operator which defines how