Author: kahatlen
Date: Wed Nov 2 13:05:04 2011
New Revision: 1196562
URL: http://svn.apache.org/viewvc?rev=1196562&view=rev
Log:
DERBY-4845: Improve the dependency tracking for our build targets
Use DependableFinder interface instead of impl classes in iapi code.
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ColPermsDescriptor.java
db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/PermDescriptor.java
db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/RoleGrantDescriptor.java
db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/RoutinePermsDescriptor.java
db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SequenceDescriptor.java
db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TablePermsDescriptor.java
db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TupleDescriptor.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ColPermsDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ColPermsDescriptor.java?rev=1196562&r1=1196561&r2=1196562&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ColPermsDescriptor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ColPermsDescriptor.java
Wed Nov 2 13:05:04 2011
@@ -26,10 +26,8 @@ import org.apache.derby.catalog.Dependab
import org.apache.derby.catalog.UUID;
import org.apache.derby.iapi.error.StandardException;
-import org.apache.derby.iapi.sql.dictionary.DataDictionary;
import org.apache.derby.iapi.services.io.FormatableBitSet;
import org.apache.derby.iapi.services.io.StoredFormatIds;
-import org.apache.derby.impl.sql.catalog.DDdependableFinder;
/**
* This class describes a row in the SYS.SYSCOLPERMS system table, which keeps
@@ -166,7 +164,8 @@ public class ColPermsDescriptor extends
*/
public DependableFinder getDependableFinder()
{
- return new DDdependableFinder(StoredFormatIds.COLUMNS_PERMISSION_FINDER_V01_ID);
+ return getDependableFinder(
+ StoredFormatIds.COLUMNS_PERMISSION_FINDER_V01_ID);
}
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java?rev=1196562&r1=1196561&r2=1196562&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
Wed Nov 2 13:05:04 2011
@@ -35,6 +35,7 @@ import org.apache.derby.iapi.error.Stand
import org.apache.derby.iapi.store.access.TransactionController;
import org.apache.derby.iapi.types.RowLocation;
+import org.apache.derby.catalog.DependableFinder;
import org.apache.derby.catalog.TypeDescriptor;
import org.apache.derby.catalog.UUID;
import org.apache.derby.iapi.services.uuid.UUIDFactory;
@@ -2241,4 +2242,25 @@ public interface DataDictionary
* system resources and potentially cause side-effects due to the errors.
*/
public void disableIndexStatsRefresher();
+
+ /**
+ * Get a {@code DependableFinder} instance.
+ *
+ * @param formatId the format id
+ * @return an instance capable of finding {@code Dependable}s with the
+ * specified format id
+ */
+ public DependableFinder getDependableFinder(int formatId);
+
+ /**
+ * Get a {@code DependableFinder} instance for referenced columns in
+ * a table.
+ *
+ * @param formatId the format id
+ * @param columnBitMap byte array encoding the bitmap of referenced columns
+ * @return an instance capable of finding {@code Dependable}s with the
+ * specified format id
+ */
+ public DependableFinder getColumnDependableFinder(
+ int formatId, byte[] columnBitMap);
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/PermDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/PermDescriptor.java?rev=1196562&r1=1196561&r2=1196562&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/PermDescriptor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/PermDescriptor.java
Wed Nov 2 13:05:04 2011
@@ -29,8 +29,6 @@ import org.apache.derby.iapi.reference.S
import org.apache.derby.iapi.services.sanity.SanityManager;
import org.apache.derby.iapi.services.io.StoredFormatIds;
import org.apache.derby.iapi.sql.depend.Provider;
-import org.apache.derby.impl.sql.catalog.DDdependableFinder;
-import org.apache.derby.iapi.sql.dictionary.PrivilegedSQLObject;
/**
* This class describes rows in the SYS.SYSPERMS system table, which keeps track of the
@@ -209,7 +207,8 @@ public class PermDescriptor extends Perm
* @see Dependable#getDependableFinder
*/
public DependableFinder getDependableFinder() {
- return new DDdependableFinder(StoredFormatIds.PERM_DESCRIPTOR_FINDER_V01_ID);
+ return getDependableFinder(
+ StoredFormatIds.PERM_DESCRIPTOR_FINDER_V01_ID);
}
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/RoleGrantDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/RoleGrantDescriptor.java?rev=1196562&r1=1196561&r2=1196562&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/RoleGrantDescriptor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/RoleGrantDescriptor.java
Wed Nov 2 13:05:04 2011
@@ -30,7 +30,6 @@ import org.apache.derby.iapi.services.io
import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
import org.apache.derby.iapi.sql.depend.Provider;
import org.apache.derby.iapi.store.access.TransactionController;
-import org.apache.derby.impl.sql.catalog.DDdependableFinder;
/**
* This class is used by rows in the SYS.SYSROLES system table.
@@ -209,6 +208,6 @@ public class RoleGrantDescriptor extends
*/
public DependableFinder getDependableFinder()
{
- return new DDdependableFinder(StoredFormatIds.ROLE_GRANT_FINDER_V01_ID);
+ return getDependableFinder(StoredFormatIds.ROLE_GRANT_FINDER_V01_ID);
}
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/RoutinePermsDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/RoutinePermsDescriptor.java?rev=1196562&r1=1196561&r2=1196562&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/RoutinePermsDescriptor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/RoutinePermsDescriptor.java
Wed Nov 2 13:05:04 2011
@@ -27,8 +27,6 @@ import org.apache.derby.catalog.UUID;
import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.services.io.StoredFormatIds;
-import org.apache.derby.iapi.sql.dictionary.DataDictionary;
-import org.apache.derby.impl.sql.catalog.DDdependableFinder;
/**
* This class describes rows in the SYS.SYSROUTINEPERMS system table, which keeps track of
the routine
@@ -163,6 +161,7 @@ public class RoutinePermsDescriptor exte
*/
public DependableFinder getDependableFinder()
{
- return new DDdependableFinder(StoredFormatIds.ROUTINE_PERMISSION_FINDER_V01_ID);
+ return getDependableFinder(
+ StoredFormatIds.ROUTINE_PERMISSION_FINDER_V01_ID);
}
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SequenceDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SequenceDescriptor.java?rev=1196562&r1=1196561&r2=1196562&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SequenceDescriptor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SequenceDescriptor.java
Wed Nov 2 13:05:04 2011
@@ -34,7 +34,6 @@ import org.apache.derby.iapi.sql.conn.La
import org.apache.derby.iapi.types.DataTypeDescriptor;
import org.apache.derby.iapi.types.TypeId;
import org.apache.derby.iapi.store.access.TransactionController;
-import org.apache.derby.impl.sql.catalog.DDdependableFinder;
/**
* This class is used by rows in the SYS.SYSSEQUENCES system table.
@@ -305,7 +304,8 @@ public class SequenceDescriptor extends
* @see Dependable#getDependableFinder
*/
public DependableFinder getDependableFinder() {
- return new DDdependableFinder(StoredFormatIds.SEQUENCE_DESCRIPTOR_FINDER_V01_ID);
+ return getDependableFinder(
+ StoredFormatIds.SEQUENCE_DESCRIPTOR_FINDER_V01_ID);
}
/*Accessor methods*/
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TablePermsDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TablePermsDescriptor.java?rev=1196562&r1=1196561&r2=1196562&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TablePermsDescriptor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TablePermsDescriptor.java
Wed Nov 2 13:05:04 2011
@@ -26,9 +26,7 @@ import org.apache.derby.catalog.Dependab
import org.apache.derby.catalog.UUID;
import org.apache.derby.iapi.services.io.StoredFormatIds;
-import org.apache.derby.iapi.sql.dictionary.DataDictionary;
import org.apache.derby.iapi.error.StandardException;
-import org.apache.derby.impl.sql.catalog.DDdependableFinder;
/**
* This class describes a row in the SYS.SYSTABLEPERMS system table, which
@@ -183,6 +181,7 @@ public class TablePermsDescriptor extend
*/
public DependableFinder getDependableFinder()
{
- return new DDdependableFinder(StoredFormatIds.TABLE_PERMISSION_FINDER_V01_ID);
+ return getDependableFinder(
+ StoredFormatIds.TABLE_PERMISSION_FINDER_V01_ID);
}
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TupleDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TupleDescriptor.java?rev=1196562&r1=1196561&r2=1196562&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TupleDescriptor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TupleDescriptor.java
Wed Nov 2 13:05:04 2011
@@ -21,18 +21,9 @@
package org.apache.derby.iapi.sql.dictionary;
-import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
-import org.apache.derby.iapi.error.StandardException;
-
import org.apache.derby.catalog.DependableFinder;
import org.apache.derby.iapi.services.sanity.SanityManager;
-import org.apache.derby.iapi.reference.SQLState;
-
-// is it OK to do this?
-import org.apache.derby.impl.sql.catalog.DDdependableFinder;
-import org.apache.derby.impl.sql.catalog.DDColumnDependableFinder;
-
/**
* This is the superclass of all Descriptors. Users of DataDictionary should use
* the specific descriptor.
@@ -98,15 +89,15 @@ public class TupleDescriptor
//////////////////////////////////////////////////////////////////
- public DependableFinder getDependableFinder(int formatId)
+ DependableFinder getDependableFinder(int formatId)
{
- return new DDdependableFinder(formatId);
+ return dataDictionary.getDependableFinder(formatId);
}
DependableFinder getColumnDependableFinder(int formatId, byte[]
columnBitMap)
{
- return new DDColumnDependableFinder(formatId, columnBitMap);
+ return dataDictionary.getColumnDependableFinder(formatId, columnBitMap);
}
/** Each descriptor must identify itself with its type; i.e index, check
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?rev=1196562&r1=1196561&r2=1196562&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
Wed Nov 2 13:05:04 2011
@@ -139,6 +139,7 @@ import org.apache.derby.impl.services.lo
import org.apache.derby.iapi.services.uuid.UUIDFactory;
import org.apache.derby.catalog.AliasInfo;
import org.apache.derby.catalog.DefaultInfo;
+import org.apache.derby.catalog.DependableFinder;
import org.apache.derby.catalog.TypeDescriptor;
import org.apache.derby.catalog.UUID;
import org.apache.derby.catalog.types.BaseTypeIdImpl;
@@ -13908,4 +13909,13 @@ public final class DataDictionaryImpl
indexStatsUpdateTracing, db, authorizationDatabaseOwner,
dbName);
}
+
+ public DependableFinder getDependableFinder(int formatId) {
+ return new DDdependableFinder(formatId);
+ }
+
+ public DependableFinder getColumnDependableFinder(
+ int formatId, byte[] columnBitMap) {
+ return new DDColumnDependableFinder(formatId, columnBitMap);
+ }
}
Modified: db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java?rev=1196562&r1=1196561&r2=1196562&view=diff
==============================================================================
--- db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java
(original)
+++ db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java
Wed Nov 2 13:05:04 2011
@@ -24,6 +24,7 @@ import java.util.Hashtable;
import java.util.List;
import java.util.Properties;
+import org.apache.derby.catalog.DependableFinder;
import org.apache.derby.catalog.UUID;
import org.apache.derby.iapi.db.Database;
import org.apache.derby.iapi.error.StandardException;
@@ -897,4 +898,13 @@ public class EmptyDictionary implements
public void createIndexStatsRefresher(Database db, String dbName) {
// Do nothing
}
+
+ public DependableFinder getDependableFinder(int formatId) {
+ return null;
+ }
+
+ public DependableFinder getColumnDependableFinder(
+ int formatId, byte[] columnBitMap) {
+ return null;
+ }
}
|